Added new alerts to scanner page

main
Kai Mannweiler 2023-02-27 20:30:24 +01:00
parent f0e3a1ff6b
commit bb96aaeef9
2 changed files with 20 additions and 17 deletions

View File

@ -1,3 +1,4 @@
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smoke_cess_app/models/mood.dart';
@ -32,6 +33,12 @@ class ScannerPage extends StatelessWidget {
await loadSettingsFromLocalJSON();
settingsModel.initSettings();
NotificationService().setAllNotifications();
AwesomeDialog(
context: context,
dialogType: DialogType.success,
title: 'Geschafft',
desc: 'Die Einstellung wurden erfolgreich gespeichert',
).show();
}
@override

View File

@ -1,3 +1,4 @@
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:flutter/material.dart';
import 'package:mobile_scanner/mobile_scanner.dart';
import 'package:provider/provider.dart';
@ -21,15 +22,12 @@ class MyScannerState extends State<MyScanner> {
void handleError() {
setState(() {
scanning = false;
showDialog(
AwesomeDialog(
context: context,
builder: (BuildContext context) {
return const MissingConfigPopup(
title: 'Scanfehler',
text:
'Beim Scanen gab es wohl einen Fehler. Bitte erneut versuchen',
);
});
dialogType: DialogType.error,
title: 'Upss',
desc: 'Da muss etwas schiefgelaufen sein!',
).show();
});
}
@ -43,14 +41,12 @@ class MyScannerState extends State<MyScanner> {
NotificationService().setAllNotifications();
setState(() {
scanning = false;
showDialog(
AwesomeDialog(
context: context,
builder: (BuildContext context) {
return MissingConfigPopup(
title: 'Konfiguration erfolgreich',
text: 'Du gehörst zu Gruppe ${settings.group}',
);
});
dialogType: DialogType.success,
title: 'Geschafft',
desc: 'Der Code wurde erfolgreich gescannt!',
).show();
});
}