customShowSnackbar static method

Future<void> customShowSnackbar(
  1. BuildContext context, {
  2. String? status,
  3. String? title,
  4. String? message,
  5. Color? colorWaring,
  6. VoidCallback? callBack,
})

Implementation

static Future<void> customShowSnackbar(BuildContext context, {String? status, String? title, String? message, Color? colorWaring, VoidCallback? callBack}) async {
  await showDialog(
    context: context,
    barrierDismissible: true,
    builder: (BuildContext context) {
      return CustomDialogOne(
          content: message ?? StatusHelper.getMessageStatusCall(status: status),
          title: "Thông báo",
          positiveBtnText: "Đồng ý",
          iconWarning: CustomIcon(icon: Icons.warning, color: Colors.white, size: Sizes.ICON_SIZE_24),
          positiveBtnPressed: () {
            if (callBack != null) {
              Navigator.of(context).pop();
              return callBack();
            } else {
              Navigator.of(context).pop();
            }
          });
    }
  );
}