showAlert static method

void showAlert({
  1. String? title,
  2. required String message,
  3. List<Widget>? actions,
  4. Widget? content,
  5. required BuildContext context,
  6. bool? barrierDismissible,
})

Implementation

static void showAlert(
    {String? title,
    required String message,
    List<Widget>? actions,
    Widget? content,
    required BuildContext context,
    bool? barrierDismissible}) {
  showDialog(
    context: context,
    barrierDismissible: barrierDismissible ?? true,
    builder: (BuildContext context) {
      return AlertDialog(
        backgroundColor:
            MirrorflyUikit.theme == "dark" ? darkPopupColor : Colors.white,
        title: title != null
            ? Text(
                title,
                style: TextStyle(
                    fontSize: 17,
                    color: MirrorflyUikit.getTheme?.textPrimaryColor),
              )
            : const SizedBox.shrink(),
        contentPadding: title != null
            ? const EdgeInsets.only(top: 15, right: 25, left: 25, bottom: 0)
            : const EdgeInsets.only(top: 0, right: 25, left: 25, bottom: 5),
        content: content ??
            Text(
              message,
              style: TextStyle(
                  color: MirrorflyUikit.getTheme?.textSecondaryColor,
                  fontWeight: FontWeight.normal),
            ),
        contentTextStyle: TextStyle(
            color: MirrorflyUikit.getTheme?.textSecondaryColor,
            fontWeight: FontWeight.w500),
        actions: actions,
      );
    },
  );
}