forked from firka/student-legacy
added "soon alert" widget
This commit is contained in:
parent
d0f347c80d
commit
25294dd4a7
22
filcnaplo_mobile_ui/lib/common/soon_alert/soon_alert.dart
Normal file
22
filcnaplo_mobile_ui/lib/common/soon_alert/soon_alert.dart
Normal file
@ -0,0 +1,22 @@
|
||||
import 'package:filcnaplo_mobile_ui/common/action_button.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/soon_alert/soon_alert.i18n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SoonAlert extends StatelessWidget {
|
||||
const SoonAlert({Key? key}) : super(key: key);
|
||||
|
||||
static show({required BuildContext context}) =>
|
||||
showDialog(context: context, builder: (context) => const SoonAlert());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
|
||||
title: Text('soon'.i18n),
|
||||
content: Text('soon_body'.i18n),
|
||||
actions: [
|
||||
ActionButton(label: "Ok", onTap: () => Navigator.of(context).pop())
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
import 'package:i18n_extension/i18n_extension.dart';
|
||||
|
||||
extension Localization on String {
|
||||
static final _t = Translations.byLocale("hu_hu") +
|
||||
{
|
||||
"en_en": {
|
||||
"soon": "Soon...",
|
||||
"soon_body": "This feature is currently not available yet!",
|
||||
},
|
||||
"hu_hu": {
|
||||
"soon": "Hamarosan...",
|
||||
"soon_body": "Ez a funkció jelenleg még nem elérhető!",
|
||||
},
|
||||
"de_de": {
|
||||
"soon": "Bald...",
|
||||
"soon_body": "Diese Funktion ist derzeit noch nicht verfügbar!",
|
||||
},
|
||||
};
|
||||
|
||||
String get i18n => localize(this, _t);
|
||||
String fill(List<Object> params) => localizeFill(this, params);
|
||||
String plural(int value) => localizePlural(value, this, _t);
|
||||
String version(Object modifier) => localizeVersion(modifier, this, _t);
|
||||
}
|
@ -11,6 +11,7 @@ import 'package:filcnaplo_mobile_ui/common/filter_bar.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_button.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
|
||||
import 'package:filcnaplo/ui/filter/sort.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/soon_alert/soon_alert.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/message/message_viewable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
@ -80,6 +81,7 @@ class _MessagesPageState extends State<MessagesPage>
|
||||
// [DeviceOrientation.portraitUp]);
|
||||
// setSystemChrome(context);
|
||||
// });
|
||||
SoonAlert.show(context: context);
|
||||
},
|
||||
icon: Icon(
|
||||
FeatherIcons.send,
|
||||
|
Loading…
x
Reference in New Issue
Block a user