From eb0c501e42c8376ea18dc8da905e23063912e305 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Mon, 21 Jul 2025 11:33:09 +0200 Subject: [PATCH] add success and error to new alertservce --- .../lib/mih_services/mih_alert_services.dart | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/Frontend/lib/mih_services/mih_alert_services.dart b/Frontend/lib/mih_services/mih_alert_services.dart index 431834cc..35157e4b 100644 --- a/Frontend/lib/mih_services/mih_alert_services.dart +++ b/Frontend/lib/mih_services/mih_alert_services.dart @@ -55,4 +55,66 @@ class MihAlertServices { }, ); } + + void successAlert(String title, String message, BuildContext context) { + showDialog( + context: context, + builder: (context) { + return MihPackageAlert( + alertIcon: Icon( + Icons.check_circle_outline_rounded, + size: 150, + color: MzansiInnovationHub.of(context)!.theme.successColor(), + ), + alertTitle: title, + alertBody: Column( + children: [ + Text( + message, + style: TextStyle( + color: + MzansiInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 25), + ], + ), + alertColour: MzansiInnovationHub.of(context)!.theme.successColor(), + ); + }, + ); + } + + void errorAlert(String title, String message, BuildContext context) { + showDialog( + context: context, + builder: (context) { + return MihPackageAlert( + alertIcon: Icon( + Icons.warning_amber_rounded, + size: 150, + color: MzansiInnovationHub.of(context)!.theme.errorColor(), + ), + alertTitle: title, + alertBody: Column( + children: [ + Text( + message, + style: TextStyle( + color: + MzansiInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 25), + ], + ), + alertColour: MzansiInnovationHub.of(context)!.theme.errorColor(), + ); + }, + ); + } }