fixed flutter analyze issues introduced with new flutter version
parent
7cc60b180a
commit
cd07acc3b5
|
@ -20,12 +20,14 @@ class ScannerPage extends StatelessWidget {
|
||||||
await loadSettingsFromLocalJSON();
|
await loadSettingsFromLocalJSON();
|
||||||
settingsModel.initSettings();
|
settingsModel.initSettings();
|
||||||
NotificationService().setAllNotifications();
|
NotificationService().setAllNotifications();
|
||||||
AwesomeDialog(
|
if (context.mounted) {
|
||||||
context: context,
|
AwesomeDialog(
|
||||||
dialogType: DialogType.success,
|
context: context,
|
||||||
title: 'Geschafft',
|
dialogType: DialogType.success,
|
||||||
desc: 'Die Einstellung wurden erfolgreich gespeichert',
|
title: 'Geschafft',
|
||||||
).show();
|
desc: 'Die Einstellung wurden erfolgreich gespeichert',
|
||||||
|
).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -7,17 +7,19 @@ import '../services/pages_service.dart';
|
||||||
|
|
||||||
void showTaskDonePopup(BuildContext context, Pages page) async {
|
void showTaskDonePopup(BuildContext context, Pages page) async {
|
||||||
Duration duration = await getTimeTill(page);
|
Duration duration = await getTimeTill(page);
|
||||||
await showDialog(
|
if (context.mounted) {
|
||||||
context: context,
|
await showDialog(
|
||||||
builder: (BuildContext context) {
|
context: context,
|
||||||
return ChangeNotifierProvider(
|
builder: (BuildContext context) {
|
||||||
create: (context) => TimerProvider(),
|
return ChangeNotifierProvider(
|
||||||
child: TaskDonePopup(
|
create: (context) => TimerProvider(),
|
||||||
duration: duration,
|
child: TaskDonePopup(
|
||||||
),
|
duration: duration,
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TaskDonePopup extends StatelessWidget {
|
class TaskDonePopup extends StatelessWidget {
|
||||||
|
|
|
@ -17,22 +17,24 @@ class SubmitFormButton extends StatelessWidget {
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
int success = await submitCallback();
|
int success = await submitCallback();
|
||||||
if (success != 0) {
|
if (context.mounted) {
|
||||||
await AwesomeDialog(
|
if (success != 0) {
|
||||||
context: context,
|
await AwesomeDialog(
|
||||||
dialogType: DialogType.success,
|
context: context,
|
||||||
title: 'Gespeichert',
|
dialogType: DialogType.success,
|
||||||
desc: 'Der Eintrag wurde erfolgreich gespeichert',
|
title: 'Gespeichert',
|
||||||
).show();
|
desc: 'Der Eintrag wurde erfolgreich gespeichert',
|
||||||
updateTasks();
|
).show();
|
||||||
pageProvider.swap();
|
updateTasks();
|
||||||
} else {
|
pageProvider.swap();
|
||||||
await AwesomeDialog(
|
} else {
|
||||||
context: context,
|
await AwesomeDialog(
|
||||||
dialogType: DialogType.error,
|
context: context,
|
||||||
title: 'Fehler',
|
dialogType: DialogType.error,
|
||||||
desc: 'Der Eintrag konnte nicht gespeichert werden',
|
title: 'Fehler',
|
||||||
).show();
|
desc: 'Der Eintrag konnte nicht gespeichert werden',
|
||||||
|
).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: const Text('Speichern'),
|
child: const Text('Speichern'),
|
||||||
|
|
|
@ -28,13 +28,15 @@ class WorkoutTimerWidget extends StatelessWidget {
|
||||||
workoutProvider.saveWorkout();
|
workoutProvider.saveWorkout();
|
||||||
tasksProvider.setTaskDone(Pages.timer);
|
tasksProvider.setTaskDone(Pages.timer);
|
||||||
}, 'Motivation nach dem Training');
|
}, 'Motivation nach dem Training');
|
||||||
await AwesomeDialog(
|
if (context.mounted) {
|
||||||
context: context,
|
await AwesomeDialog(
|
||||||
dialogType: DialogType.success,
|
context: context,
|
||||||
title: 'Gespeichert',
|
dialogType: DialogType.success,
|
||||||
desc: 'Der Eintrag wurde erfolgreich gespeichert',
|
title: 'Gespeichert',
|
||||||
).show();
|
desc: 'Der Eintrag wurde erfolgreich gespeichert',
|
||||||
pageProvider.swap();
|
).show();
|
||||||
|
pageProvider.swap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workoutProvider.isPhaseComplete && !workoutProvider.isWorkoutComplete) {
|
if (workoutProvider.isPhaseComplete && !workoutProvider.isWorkoutComplete) {
|
||||||
|
|
Loading…
Reference in New Issue