fixed flutter analyze issues introduced with new flutter version

main
Julian Gegner 2023-03-04 10:29:35 +01:00
parent 7cc60b180a
commit cd07acc3b5
4 changed files with 48 additions and 40 deletions

View File

@ -20,6 +20,7 @@ class ScannerPage extends StatelessWidget {
await loadSettingsFromLocalJSON();
settingsModel.initSettings();
NotificationService().setAllNotifications();
if (context.mounted) {
AwesomeDialog(
context: context,
dialogType: DialogType.success,
@ -27,6 +28,7 @@ class ScannerPage extends StatelessWidget {
desc: 'Die Einstellung wurden erfolgreich gespeichert',
).show();
}
}
@override
Widget build(BuildContext context) {

View File

@ -7,6 +7,7 @@ import '../services/pages_service.dart';
void showTaskDonePopup(BuildContext context, Pages page) async {
Duration duration = await getTimeTill(page);
if (context.mounted) {
await showDialog(
context: context,
builder: (BuildContext context) {
@ -19,6 +20,7 @@ void showTaskDonePopup(BuildContext context, Pages page) async {
},
);
}
}
class TaskDonePopup extends StatelessWidget {
final Duration duration;

View File

@ -17,6 +17,7 @@ class SubmitFormButton extends StatelessWidget {
child: ElevatedButton(
onPressed: () async {
int success = await submitCallback();
if (context.mounted) {
if (success != 0) {
await AwesomeDialog(
context: context,
@ -34,6 +35,7 @@ class SubmitFormButton extends StatelessWidget {
desc: 'Der Eintrag konnte nicht gespeichert werden',
).show();
}
}
},
child: const Text('Speichern'),
),

View File

@ -28,6 +28,7 @@ class WorkoutTimerWidget extends StatelessWidget {
workoutProvider.saveWorkout();
tasksProvider.setTaskDone(Pages.timer);
}, 'Motivation nach dem Training');
if (context.mounted) {
await AwesomeDialog(
context: context,
dialogType: DialogType.success,
@ -36,6 +37,7 @@ class WorkoutTimerWidget extends StatelessWidget {
).show();
pageProvider.swap();
}
}
if (workoutProvider.isPhaseComplete && !workoutProvider.isWorkoutComplete) {
Timer(const Duration(milliseconds: 1), () => workoutProvider.nextPhase());