showCustomAlertDialog static method

Future<bool?> showCustomAlertDialog(
  1. dynamic context,
  2. dynamic message, {
  3. dynamic title,
  4. dynamic isActionCancel = false,
})

Implementation

static Future<bool?> showCustomAlertDialog(final context, message,
    {title, isActionCancel = false}) {
  final LanguageKey languageKey = LanguageKey();
  title ??= MultiLanguage.get(languageKey.ttlWarning);

  List<Widget> actions = [];
  if (isActionCancel) {actions.add(_addAction(context, MultiLanguage
      .get(languageKey.btnCancel), false, bgColor: Colors.grey));}
  actions.add(_addAction(context, MultiLanguage.get(languageKey.btnOK), true));

  return showDialog(context: context, barrierDismissible: false,
      builder: (context) => AlertDialog(title: Text(title), content: Text(message), actions: actions)
  );
}