modalSellOn method
dynamic
modalSellOn(})
Implementation
modalSellOn(BuildContext context,
{String? title,
String? message,
Function()? onOke,
Function()? onCancel,
Color? colorOk,
Color? colorNo,
bool? barierDismisable,
bool? alone}) {
if (barierDismisable == null) {
barierDismisable = true;
}
Widget cancelIosButton = CupertinoDialogAction(
// isDestructiveAction : true,
child: DefaultText(
textLabel: "No",
// textLabel: "No",
colorsText: colorNo != null ? colorNo : Colors.blue,
),
onPressed:
onCancel != null ? onCancel : () => Navigator.of(context).pop(),
);
Widget proccessIosButton = CupertinoDialogAction(
child: DefaultText(
textLabel: alone != null
? "Ok"
: "Yes",
// textLabel: "Ok",
colorsText: colorOk != null ? colorOk : Colors.red,
),
onPressed: onOke,
);
CupertinoAlertDialog curpertionalertDialog = CupertinoAlertDialog(
// title: DefaultText(
// textLabel: "Sellon",
// fontWeight: FontWeight.bold,
// sizeText: 16,
// ),
content: DefaultText(
textLabel: message,
colorsText: Colors.black,
),
actions: alone != null
? [proccessIosButton]
: [cancelIosButton, proccessIosButton],
);
// show the dialog
showCupertinoDialog(
context: context,
barrierDismissible: barierDismisable,
builder: (BuildContext context) {
return WillPopScope(
onWillPop: barierDismisable != null
? () async => false
: () async => backContent(context, barierDismisable),
child: curpertionalertDialog);
});
}