showDialogBox method

Future showDialogBox(
  1. BuildContext context
)

Implementation

Future<dynamic> showDialogBox(BuildContext context) async {
  return showDialog(
    context: context,
    builder: (context) => AlertDialog(
      // change the shape of the dialog box to bordered rect
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(
          dialogRadius ?? 5,
        ),
      ),
      backgroundColor: dialogBackgroundColor ?? Colors.white,
      surfaceTintColor: dialogBackgroundColor ?? Colors.white,

      // title text of the dialog
      title: Text(
        titleText,
        style: titleStyle ??
            const TextStyle(
              fontWeight: FontWeight.w600,
              fontSize: 18,
            ),
      ),

      // content text of the dialog
      content: Text(
        contentText,
        style: contentStyle ?? const TextStyle(color: Colors.black54),
      ),

      // action buttons of the dialog
      actions: buttons,
      actionsAlignment: buttonsAlignment,
    ),
  );
}