dialog method

Future dialog({
  1. required BuildContext context,
  2. required PopupType type,
  3. required String title,
  4. required String message,
  5. String? buttonLabel,
  6. Color? buttonColor,
  7. Icon? icon,
  8. List<Widget> buttons = const [],
})

Implementation

Future<dynamic> dialog({
  required BuildContext context,
  required PopupType type,
  required String title,
  required String message,
  String? buttonLabel,
  Color? buttonColor,
  Icon? icon,
  List<Widget> buttons = const [],
}) {
  return PopupDialog(
    header: PopupHeader(
      icon: icon ?? config.iconByType[type],
      title: PopupText(text: title),
    ),
    content: PopupMessage(
      message: PopupText(text: message),
      config: config,
      height: type == PopupType.choose ? config.chooseMessageHeight : config.shortMessageHeight,
    ),
    config: config,
    buttons: buttons,
  ).show(context);
}