feat: Prevent exiting installer on new back button as well and show why exiting is not possible during patching

This commit is contained in:
Alberto Ponces
2022-09-19 17:40:06 +01:00
parent 2a2bb8212f
commit bed2cf76d5
4 changed files with 27 additions and 10 deletions

View File

@ -29,6 +29,7 @@ class InstallerView extends StatelessWidget {
color: Theme.of(context).textTheme.headline6!.color,
),
),
onBackButtonPressed: () => model.onWillPop(context),
actions: <Widget>[
Visibility(
visible: !model.isPatching && !model.hasErrors,
@ -143,13 +144,7 @@ class InstallerView extends StatelessWidget {
],
),
),
onWillPop: () async {
if (!model.isPatching) {
model.cleanPatcher();
Navigator.of(context).pop();
}
return false;
},
onWillPop: () => model.onWillPop(context),
),
);
}