From 01150f9458e5a9bdded0c4606ca25766ff9202eb Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 6 Jun 2025 13:50:45 +0200 Subject: [PATCH] create alert service --- Frontend/lib/mih_apis/mih_alert_services.dart | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Frontend/lib/mih_apis/mih_alert_services.dart diff --git a/Frontend/lib/mih_apis/mih_alert_services.dart b/Frontend/lib/mih_apis/mih_alert_services.dart new file mode 100644 index 00000000..8f9e2a64 --- /dev/null +++ b/Frontend/lib/mih_apis/mih_alert_services.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; +import 'package:mzansi_innovation_hub/main.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; + +class MihAlertServices { + void formNotFilledCompletely(BuildContext context) { + showDialog( + context: context, + builder: (context) { + return MihPackageAlert( + alertIcon: Icon( + Icons.warning_amber_rounded, + size: 150, + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + ), + alertTitle: "Oops! Looks like some fields are missing.", + alertBody: Column( + children: [ + Text( + "We noticed that some required fields are still empty. To ensure your request is processed smoothly, please fill out all the highlighted fields before submitting the form again.", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 25), + RichText( + text: TextSpan( + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: 15, + fontWeight: FontWeight.bold, + ), + children: [ + TextSpan( + text: "Here's a quick tip: ", + style: TextStyle( + fontStyle: FontStyle.italic, + color: MzanziInnovationHub.of(context)! + .theme + .errorColor())), + const TextSpan( + text: + "Look for fields without the \"(Optional)\" indicator next to them, as these are mandatory."), + ], + ), + ), + ], + ), + alertColour: MzanziInnovationHub.of(context)!.theme.errorColor(), + ); + }, + ); + } +}