yShowStatefulDialog function
void
yShowStatefulDialog({
- required dynamic alertBuilder(
- BuildContext pageContext,
- BuildContext? dialogContext,
- BuildContext statefulContext,
- StateSetter setDialogState,
- bool dismissible = true,
- BuildContext? context,
Implementation
void yShowStatefulDialog({required Function(BuildContext pageContext, BuildContext? dialogContext, BuildContext statefulContext, StateSetter setDialogState) alertBuilder, bool dismissible = true, BuildContext? context}) {
showDialog(
context: context ?? yPages.last.context,
barrierDismissible: dismissible,
builder: (dialogContext) {
if (!dismissible) _dialogContext = dialogContext;
return WillPopScope(
onWillPop: () => Future.value(dismissible),
child: StatefulBuilder(
builder: (statefulContext, setDialogState) => alertBuilder(context ?? yPages.last.context, dismissible ? dialogContext : null, statefulContext, setDialogState),
),
);
},
);
}