From 25862b86b1e39c9376a99664b76838519c400b2f Mon Sep 17 00:00:00 2001 From: yaso Date: Wed, 12 Feb 2025 12:31:40 +0200 Subject: [PATCH] add delete confirmation prompt for appointment delete --- .../mih_delete_message.dart | 84 ++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/Frontend/lib/mih_components/mih_pop_up_messages/mih_delete_message.dart b/Frontend/lib/mih_components/mih_pop_up_messages/mih_delete_message.dart index 229057eb..df7e0cf4 100644 --- a/Frontend/lib/mih_components/mih_pop_up_messages/mih_delete_message.dart +++ b/Frontend/lib/mih_components/mih_pop_up_messages/mih_delete_message.dart @@ -297,6 +297,88 @@ class _MIHDeleteMessageState extends State { ); } + void setDeleteAppointment() { + messageTypes["Appointment"] = Stack( + children: [ + Container( + padding: EdgeInsets.all(popUpPaddingSize), + width: popUpWidth, + height: popUpheight, + decoration: BoxDecoration( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 5.0), + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.warning_amber_rounded, + size: popUpIconSize, + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + //const SizedBox(height: 15), + Text( + "Are you sure you want to delete this?", + textAlign: TextAlign.center, + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: popUpTitleSize, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 15), + Text( + "This appointment will be deleted permanently from your calendar. Are you certain you want to delete it?", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: popUpBodySize, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 15), + SizedBox( + width: 300, + height: 50, + child: MIHButton( + onTap: widget.onTap, + buttonText: "Delete", + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + textColor: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + )) + ], + ), + ), + ), + Positioned( + top: 5, + right: 5, + width: 50, + height: 50, + child: IconButton( + onPressed: () { + Navigator.pop(context); + }, + icon: Icon( + Icons.close, + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + size: 35, + ), + ), + ), + ], + ); + } + Widget? getDeleteMessage(String type) { return messageTypes[type]; } @@ -317,7 +399,7 @@ class _MIHDeleteMessageState extends State { setDeleteNote(); setFileNote(); setDeleteEmployee(); - + setDeleteAppointment(); //print(size); // setState(() { // width = size.width;