Rakesh Lanjewar

Added will pop scope to defaultDialog

... ... @@ -314,6 +314,9 @@ extension ExtensionDialog on GetInterface {
double radius = 20.0,
// ThemeData themeData,
List<Widget> actions,
// onWillPop Scope
WillPopCallback onWillPop,
}) {
var leanCancel = onCancel != null || textCancel != null;
var leanConfirm = onConfirm != null || textConfirm != null;
... ... @@ -362,8 +365,7 @@ extension ExtensionDialog on GetInterface {
}
}
return dialog<T>(
AlertDialog(
Widget baseAlertDialog = AlertDialog(
titlePadding: EdgeInsets.all(8),
contentPadding: EdgeInsets.all(8),
backgroundColor: backgroundColor ?? theme.dialogBackgroundColor,
... ... @@ -392,10 +394,23 @@ extension ExtensionDialog on GetInterface {
),
// actions: actions, // ?? <Widget>[cancelButton, confirmButton],
buttonPadding: EdgeInsets.zero,
);
if (onWillPop != null) {
return dialog<T>(
WillPopScope(
onWillPop: onWillPop,
child: baseAlertDialog,
),
barrierDismissible: barrierDismissible,
);
}
return dialog<T>(
baseAlertDialog,
barrierDismissible: barrierDismissible,
);
}
}
extension ExtensionBottomSheet on GetInterface {
... ...