From bb54605ddba7d401e87cfea5c9583600cb02748f Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 21 Nov 2025 10:26:57 +0200 Subject: [PATCH] QOL: Create advanced warning alert --- .../lib/mih_services/mih_alert_services.dart | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/Frontend/lib/mih_services/mih_alert_services.dart b/Frontend/lib/mih_services/mih_alert_services.dart index 46785027..ff0fb09b 100644 --- a/Frontend/lib/mih_services/mih_alert_services.dart +++ b/Frontend/lib/mih_services/mih_alert_services.dart @@ -736,6 +736,71 @@ class MihAlertServices { ); } + void warningAdvancedAlert( + String title, + String message, + List actions, + BuildContext context, + ) { + showDialog( + context: context, + barrierDismissible: false, + builder: (context) { + return MihPackageWindow( + fullscreen: false, + windowTitle: null, + onWindowTapClose: null, + backgroundColor: MihColors.getSecondaryColor( + MzansiInnovationHub.of(context)!.theme.mode == "Dark"), + windowBody: MihSingleChildScroll( + child: Column( + children: [ + Icon( + Icons.warning_amber_rounded, + size: 150, + color: MihColors.getPrimaryColor( + MzansiInnovationHub.of(context)!.theme.mode == "Dark"), + ), + Center( + child: Text( + title, + textAlign: TextAlign.center, + style: TextStyle( + color: MihColors.getPrimaryColor( + MzansiInnovationHub.of(context)!.theme.mode == + "Dark"), + fontSize: 25, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 15), + Text( + message, + style: TextStyle( + color: MihColors.getPrimaryColor( + MzansiInnovationHub.of(context)!.theme.mode == "Dark"), + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 15), + Center( + child: Wrap( + spacing: 10.0, + runSpacing: 10.0, + alignment: WrapAlignment.center, + children: actions, + ), + ), + ], + ), + ), + ); + }, + ); + } + void deleteConfirmationAlert( String message, void Function()? onpressed, @@ -968,7 +1033,7 @@ class MihAlertServices { alignment: WrapAlignment.center, children: actions, ), - ) + ), ], ), ),