showModalDialog static method
Future
showModalDialog({
- required BuildContext context,
- required Widget view,
- double radius = 10,
- Color? bg,
- ValueChanged<
BuildContext> ? ctx,
Implementation
static Future showModalDialog({
required BuildContext context,
required Widget view,
double radius = 10,
bool useRootNavigator = false,
Color? bg,
ValueChanged<BuildContext>? ctx,
}) {
return showDialog(
context: context,
useRootNavigator: useRootNavigator,
barrierDismissible: false,
builder: (BuildContext mContext) {
if (ctx != null) {
ctx(mContext);
}
return WillPopScope(
onWillPop: () async => false,
child: Dialog(
elevation: 0,
backgroundColor: bg,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(radius))),
child: view,
),
);
});
}