modalSellOnKebalik method

dynamic modalSellOnKebalik(
  1. BuildContext context, {
  2. String? title,
  3. String? message,
  4. dynamic onOke()?,
  5. dynamic onCancel()?,
  6. TextAlign? textalign,
  7. Color? colorOk,
  8. Color? colorNo,
  9. bool? alone,
})

Implementation

modalSellOnKebalik(
    BuildContext context, {
      String? title,
      String? message,
      Function()? onOke,
      Function()? onCancel,
      TextAlign? textalign,
      Color? colorOk,
      Color? colorNo,
      bool? alone,
    }) {
  Widget cancelIosButton = CupertinoDialogAction(
    // isDestructiveAction : true,
    child: DefaultText(
      textLabel: "No",
      colorsText: colorNo != null ? colorNo : Colors.black,
    ),
    onPressed:
    onCancel != null ? onCancel : () => Navigator.of(context).pop(),
  );

  Widget proccessIosButton = CupertinoDialogAction(
    child: DefaultText(
      textLabel: alone != null
          ? "Oke"
          : "Yes",
      colorsText: colorOk != null ? colorOk : Config.colorPrimary,
    ),
    onPressed: onOke,
  );

  CupertinoAlertDialog curpertionalertDialog = CupertinoAlertDialog(
    // title: DefaultText(
    //   textLabel: "Sellon",
    //   fontWeight: FontWeight.bold,
    //   sizeText: 16,
    // ),
    content: DefaultText(
      textLabel: message,
      textAlign: textalign != null ? textalign : null,
      colorsText: Colors.black,
    ),
    actions: alone != null
        ? [proccessIosButton]
        : [
      proccessIosButton,
      cancelIosButton,
    ],
  );

  // show the dialog
  if (message != "") {
    showCupertinoDialog(
        context: context,
        builder: (BuildContext context) {
          return curpertionalertDialog;
        });
  }
}