Added new alerts to scanner page
parent
f0e3a1ff6b
commit
bb96aaeef9
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return const MissingConfigPopup(
|
||||
title: 'Scanfehler',
|
||||
text:
|
||||
'Beim Scanen gab es wohl einen Fehler. Bitte erneut versuchen',
|
||||
);
|
||||
});
|
||||
AwesomeDialog(
|
||||
context: context,
|
||||
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(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return MissingConfigPopup(
|
||||
title: 'Konfiguration erfolgreich',
|
||||
text: 'Du gehörst zu Gruppe ${settings.group}',
|
||||
);
|
||||
});
|
||||
AwesomeDialog(
|
||||
context: context,
|
||||
dialogType: DialogType.success,
|
||||
title: 'Geschafft',
|
||||
desc: 'Der Code wurde erfolgreich gescannt!',
|
||||
).show();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue