warningDialog function

dynamic warningDialog(
  1. BuildContext context,
  2. String title,
  3. String content, {
  4. Widget? titleIcon,
  5. String? positiveButtonText,
  6. Function? positiveButtonAction,
  7. String? negativeButtonText,
  8. Function? negativeButtonAction,
  9. String? neutralButtonText,
  10. Function? neutralButtonAction,
  11. bool hideNeutralButton = false,
  12. bool closeOnBackPress = false,
  13. bool confirmationDialog = false,
  14. String? confirmationMessage,
})

warning dialog function with title and content string

positiveButtonText for positive button text negativeButtonText for negative button text neutralButtonText for negative button text hideNeutralButton to hide the Neutral Button default is false closeOnBackPress to close dialog on back button default is false confirmationDialog to make the confirmation dialog default is false confirmationMessage confirmation message default is 'Please check this box for Confirmation!'

Implementation

warningDialog(
  BuildContext context,
  String title,
  String content, {
  Widget? titleIcon,
  String? positiveButtonText,
  Function? positiveButtonAction,
  String? negativeButtonText,
  Function? negativeButtonAction,
  String? neutralButtonText,
  Function? neutralButtonAction,
  bool hideNeutralButton = false,
  bool closeOnBackPress = false,
  bool confirmationDialog = false,
  String? confirmationMessage,
}) {
  return customAlertDialog(
    context,
    Text(title, style: dialogTitleStyle(context)),
    Text(content,
        textAlign: TextAlign.justify, style: dialogContentStyle(context)),
    titleIcon: titleIcon ?? warningIcon(),
    positiveButtonText: positiveButtonText,
    positiveButtonAction: positiveButtonAction,
    negativeButtonText: negativeButtonText,
    negativeButtonAction: negativeButtonAction,
    neutralButtonText: neutralButtonText,
    neutralButtonAction: neutralButtonAction,
    hideNeutralButton: hideNeutralButton,
    closeOnBackPress: closeOnBackPress,
    confirmationDialog: confirmationDialog,
    confirmationMessage: confirmationMessage,
  );
}