1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Start Flutter update

This commit is contained in:
2021-03-13 15:14:54 +01:00
parent fb80f3bd52
commit 819e2a7590
24 changed files with 140 additions and 189 deletions

View File

@ -226,7 +226,7 @@ class _Element {
/// Note : if text is not null, children must be empty !!!
String text;
final _ElementStyle style;
final List<_Element> children = List();
final List<_Element> children = [];
_Element({@required this.style, this.text});

View File

@ -4,7 +4,7 @@
/// Transform a list of dynamic thins into something a list of ints
List<int> listToIntList(List<dynamic> srcList) {
List<int> list = List();
List<int> list = [];
srcList.forEach((e) {
list.add(int.parse(e));
@ -15,7 +15,7 @@ List<int> listToIntList(List<dynamic> srcList) {
/// Find the list of missing elements of a [testList] from a [srcList]
List<T> findMissingFromList<T>(List<T> srcList, List<T> testList) {
List<T> dest = List();
List<T> dest = [];
testList.forEach((f) {
if (!srcList.contains(f) && !dest.contains(f)) dest.add(f);

View File

@ -80,11 +80,11 @@ void showImageFullScreen(BuildContext context, String url) {
/// Show simple snack
void showSimpleSnack(BuildContext context, String message) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text(message)));
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(message)));
}
void snack(BuildContext context, String message) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text(message)));
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(message)));
}
/// Show an alert dialog to ask the user to enter a string
@ -194,7 +194,7 @@ Future<bool> showConfirmDialog({
if (title == null) title = tr("Confirm operation");
// Avoid potential theme issues
final scaffold = Scaffold.of(context, nullOk: true);
final scaffold = Scaffold.maybeOf(context);
final ctx = scaffold != null ? scaffold.context : context;
final result = await showDialog<bool>(