willPop static method
dynamic
willPop(
- dynamic context, {
- dynamic model,
Implementation
static willPop(context, {model}) {
if (model != null) {
if (Dynamic(model).changed(RapidFireAppRF.of(context)!.initialModel)) {
rf.msg(
context,
'Save change pending, do you want to quite anyway?',
icon: Icons.error,
actionText: 'Quit',
action: () => Navigator.pop(context),
);
} else {
if (Navigator.canPop(context)) {
Navigator.pop(context);
} else {
//SystemChannels.platform.invokeMethod('SystemNavigator.pop');
SystemNavigator.pop();
}
}
} else {
if (Navigator.canPop(context)) {
Navigator.pop(context);
} else {
//SystemChannels.platform.invokeMethod('SystemNavigator.pop');
SystemNavigator.pop();
}
}
return Future.value(true);
}