|
|
|
@ -33,10 +33,10 @@ class EditComponentPage extends HookWidget {
|
|
|
|
|
return WillPopScope( |
|
|
|
|
onWillPop: () async { |
|
|
|
|
if (!dirty && !newComponent) { |
|
|
|
|
return true; |
|
|
|
|
Navigator.of(context).pop(true); |
|
|
|
|
} else if (!dirty && anySave.value) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
Navigator.of(context).pop(true); |
|
|
|
|
} else { |
|
|
|
|
final dialogResult = await showDialog( |
|
|
|
|
context: context, |
|
|
|
|
builder: (context) { |
|
|
|
@ -61,7 +61,12 @@ class EditComponentPage extends HookWidget {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
return dialogResult == true; |
|
|
|
|
if (dialogResult == true) { |
|
|
|
|
// ignore: use_build_context_synchronously |
|
|
|
|
Navigator.of(context).pop(!newComponent); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
child: Scaffold( |
|
|
|
|
appBar: AppBar( |
|
|
|
|