diff --git a/Frontend/lib/mih_components/mih_inputs_and_buttons/mih_button.dart b/Frontend/lib/mih_components/mih_inputs_and_buttons/mih_button.dart deleted file mode 100644 index d2892ae8..00000000 --- a/Frontend/lib/mih_components/mih_inputs_and_buttons/mih_button.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'package:flutter/material.dart'; - -class MIHButton extends StatefulWidget { - final void Function()? onTap; - final String buttonText; - final Color buttonColor; - final Color textColor; - - const MIHButton({ - super.key, - required this.onTap, - required this.buttonText, - required this.buttonColor, - required this.textColor, - }); - - @override - State createState() => _MIHButtonState(); -} - -class _MIHButtonState extends State { - @override - void dispose() { - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return ElevatedButton( - onPressed: widget.onTap, - style: ElevatedButton.styleFrom( - backgroundColor: widget.buttonColor, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.0), - ), - ), - child: Text( - widget.buttonText, - style: TextStyle( - //fontWeight: FontWeight.bold, - fontSize: 20, - color: widget.textColor, - fontWeight: FontWeight.bold, - ), - ), - ); - } -} diff --git a/Frontend/lib/mih_components/mih_package_components/Example/package_tools/package_tool_one.dart b/Frontend/lib/mih_components/mih_package_components/Example/package_tools/package_tool_one.dart index 5fe1c0de..3804dbd5 100644 --- a/Frontend/lib/mih_components/mih_package_components/Example/package_tools/package_tool_one.dart +++ b/Frontend/lib/mih_components/mih_package_components/Example/package_tools/package_tool_one.dart @@ -4,6 +4,7 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart'; @@ -123,6 +124,70 @@ class _PackageToolOneState extends State { ], ), const SizedBox(height: 10), + MihButton( + onPressed: () { + print("Button Pressed"); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Click Me", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 10), + MihButton( + onPressed: () { + print("Button Pressed"); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Row( + children: [ + Icon( + Icons.delete, + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + ), + Text( + "Click Me", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + const SizedBox(height: 10), + MihButton( + onPressed: () { + print("Button Pressed"); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 300, + child: Text( + "Click Me", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 10), Container( color: Colors.black, width: 200, diff --git a/Frontend/lib/mih_components/mih_package_components/mih_button.dart b/Frontend/lib/mih_components/mih_package_components/mih_button.dart new file mode 100644 index 00000000..3c68b494 --- /dev/null +++ b/Frontend/lib/mih_components/mih_package_components/mih_button.dart @@ -0,0 +1,43 @@ +import 'package:animated_button/animated_button.dart'; +import 'package:flutter/material.dart'; + +class MihButton extends StatefulWidget { + final void Function() onPressed; + final Color buttonColor; + final double width; + final double? height; + final double? borderRadius; + final Widget child; + + const MihButton({ + super.key, + required this.onPressed, + required this.buttonColor, + required this.width, + this.height, + this.borderRadius, + required this.child, + }); + + @override + State createState() => _MihButtonState(); +} + +class _MihButtonState extends State { + @override + Widget build(BuildContext context) { + return FittedBox( + fit: BoxFit.contain, + child: AnimatedButton( + width: widget.width, + height: widget.height ?? 50.0, + borderRadius: widget.borderRadius ?? 25.0, + color: widget.buttonColor, + shadowDegree: ShadowDegree.light, + duration: 30, + onPressed: widget.onPressed, + child: FittedBox(child: widget.child), + ), + ); + } +} 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 8b334678..d9645fe1 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 @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import '../../main.dart'; -import '../mih_inputs_and_buttons/mih_button.dart'; class MIHDeleteMessage extends StatefulWidget { final String deleteType; @@ -97,18 +97,21 @@ class _MIHDeleteMessageState extends State { ), ), const SizedBox(height: 15), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - onTap: widget.onTap, - buttonText: "Delete", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: + MihButton( + onPressed: widget.onTap, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Delete", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - )) + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), ], ), ), @@ -179,18 +182,21 @@ class _MIHDeleteMessageState extends State { ), ), const SizedBox(height: 15), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - onTap: widget.onTap, - buttonText: "Delete", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: + MihButton( + onPressed: widget.onTap, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Delete", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - )) + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), ], ), ), @@ -261,18 +267,22 @@ class _MIHDeleteMessageState extends State { ), ), const SizedBox(height: 15), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - onTap: widget.onTap, - buttonText: "Delete", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: + + MihButton( + onPressed: widget.onTap, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Delete", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - )) + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), ], ), ), @@ -343,18 +353,21 @@ class _MIHDeleteMessageState extends State { ), ), const SizedBox(height: 15), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - onTap: widget.onTap, - buttonText: "Delete", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: + MihButton( + onPressed: widget.onTap, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Delete", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - )) + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), ], ), ), @@ -425,18 +438,21 @@ class _MIHDeleteMessageState extends State { ), ), const SizedBox(height: 15), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - onTap: widget.onTap, - buttonText: "Delete", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: + MihButton( + onPressed: widget.onTap, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Delete", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - )) + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), ], ), ), diff --git a/Frontend/lib/mih_components/mih_pop_up_messages/mih_success_message.dart b/Frontend/lib/mih_components/mih_pop_up_messages/mih_success_message.dart index bb0ea0b2..4a71e6d0 100644 --- a/Frontend/lib/mih_components/mih_pop_up_messages/mih_success_message.dart +++ b/Frontend/lib/mih_components/mih_pop_up_messages/mih_success_message.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import '../../main.dart'; -import '../mih_inputs_and_buttons/mih_button.dart'; class MIHSuccessMessage extends StatefulWidget { final String successType; @@ -96,18 +96,21 @@ class _MIHSuccessMessageState extends State { ), ), const SizedBox(height: 15), - SizedBox( + MihButton( + onPressed: () { + Navigator.pop(context); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - Navigator.pop(context); - }, - buttonText: "Dismiss", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Dismiss", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/about_mih/package_tools/mih_ attributes.dart b/Frontend/lib/mih_packages/about_mih/package_tools/mih_ attributes.dart index ea2a17d5..040f178b 100644 --- a/Frontend/lib/mih_packages/about_mih/package_tools/mih_ attributes.dart +++ b/Frontend/lib/mih_packages/about_mih/package_tools/mih_ attributes.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -62,18 +62,25 @@ class _MihAttributesState extends State { verticalAlignment: TableCellVerticalAlignment.middle, child: Padding( padding: const EdgeInsets.only(bottom: 15.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { launchUrlLink( Uri.parse( link, ), ); }, - buttonText: "Visit", buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + width: 100, + child: Text( + "Visit", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ), ), diff --git a/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart b/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart index 22bf024d..f1291956 100644 --- a/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart +++ b/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart @@ -1,8 +1,8 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_tile.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -81,155 +81,6 @@ class _MihInfoState extends State { } } - // void _showIOSInstallationGuide() { - // double windowFontSize = 17.0; - // showDialog( - // context: context, - // barrierDismissible: false, - // builder: (context) { - // return MihPackageWindow( - // fullscreen: false, - // windowTitle: "MIH Installation Guide (iOS)", - // windowTools: const [], - // onWindowTapClose: () { - // Navigator.of(context).pop(); - // }, - // windowBody: [ - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "In order to install MIH on your iPhone, please follow the below steps:- ", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 10), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "1. Launch MIH on Safari.", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 10), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "2. Tap the Share Button.", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 10), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "3. Scroll down and tap \"Add to Home Screen\".", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 10), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "4. Choose a name for the shortcut (Optional).", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 10), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "5. Tap \"Add\".", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 10), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "That's it! Now you can tap the MIH icon on your home screen to open it quickly.", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 10), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "If you are still having trouble, please click on the button below to view a video guide.", - // textAlign: TextAlign.left, - // style: TextStyle( - // color: MzanziInnovationHub.of(context)!.theme.errorColor(), - // fontSize: windowFontSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // const SizedBox(height: 15), - // SizedBox( - // width: 300, - // height: 50, - // child: MIHButton( - // onTap: () { - // launchSocialUrl( - // Uri.parse( - // "https://www.youtube.com/watch?v=KVK78IV28JY", - // ), - // ); - // }, - // buttonText: "Video Guide", - // buttonColor: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // textColor: - // MzanziInnovationHub.of(context)!.theme.primaryColor(), - // ), - // ), - // ], - // ); - // }, - // ); - // } - Widget founderBio() { String bio = ""; bio += "BSc Computer Science & Information Systems\n"; @@ -699,40 +550,46 @@ class _MihInfoState extends State { spacing: 10, runSpacing: 10, children: [ - SizedBox( + MihButton( + onPressed: () { + installMihTrigger(); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - installMihTrigger(); - }, - buttonText: getInstallButtonText(), - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + child: Text( + getInstallButtonText(), + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), - SizedBox( + MihButton( + onPressed: () { + launchSocialUrl( + Uri.parse( + "https://www.youtube.com/playlist?list=PLuT35kJIui0H5kXjxNOZlHoOPZbQLr4qh", + ), + ); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - launchSocialUrl( - Uri.parse( - "https://www.youtube.com/playlist?list=PLuT35kJIui0H5kXjxNOZlHoOPZbQLr4qh", - ), - ); - }, - buttonText: "MIH Beginners Guide", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + child: Text( + "MIH Beginners Guide", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ]), diff --git a/Frontend/lib/mih_packages/access_review/builder/build_access_request_list.dart b/Frontend/lib/mih_packages/access_review/builder/build_access_request_list.dart index 306a9960..4c1c067a 100644 --- a/Frontend/lib/mih_packages/access_review/builder/build_access_request_list.dart +++ b/Frontend/lib/mih_packages/access_review/builder/build_access_request_list.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; @@ -244,32 +244,40 @@ class _BuildPatientsListState extends State { runSpacing: 10, spacing: 10, children: [ - SizedBox( - width: popUpButtonWidth, - height: 50, - child: MIHButton( - onTap: () { - updateAccessAPICall(index, "declined"); - }, - buttonText: "Decline", - buttonColor: - MzanziInnovationHub.of(context)!.theme.errorColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + updateAccessAPICall(index, "declined"); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Decline", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), - SizedBox( - width: popUpButtonWidth, - height: 50, - child: MIHButton( - onTap: () { - updateAccessAPICall(index, "approved"); - }, - buttonText: "Approve", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + updateAccessAPICall(index, "approved"); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Approve", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], @@ -283,117 +291,6 @@ class _BuildPatientsListState extends State { Navigator.pop(context); }), ); - // showDialog( - // context: context, - // barrierDismissible: false, - // builder: (context) => Dialog( - // child: Stack( - // children: [ - // Container( - // //padding: const EdgeInsets.all(15.0), - // 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( - // padding: EdgeInsets.all(popUpPaddingSize), - // child: Column( - // mainAxisSize: MainAxisSize.min, - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Text( - // "Update Appointment Access", - // textAlign: TextAlign.center, - // style: TextStyle( - // color: MzanziInnovationHub.of(context)! - // .theme - // .secondaryColor(), - // fontSize: popUpTitleSize, - // fontWeight: FontWeight.bold, - // ), - // ), - // const SizedBox(height: 15.0), - // Text( - // subtitle, - // textAlign: TextAlign.left, - // style: TextStyle( - // color: MzanziInnovationHub.of(context)! - // .theme - // .secondaryColor(), - // fontSize: popUpBodySize, - // //fontWeight: FontWeight.bold, - // ), - // ), - // const SizedBox(height: 10.0), - // Wrap( - // runSpacing: 10, - // spacing: 10, - // children: [ - // SizedBox( - // width: popUpButtonWidth, - // height: 50, - // child: MIHButton( - // onTap: () { - // updateAccessAPICall(index, "declined"); - // }, - // buttonText: "Decline", - // buttonColor: MzanziInnovationHub.of(context)! - // .theme - // .errorColor(), - // textColor: MzanziInnovationHub.of(context)! - // .theme - // .primaryColor(), - // ), - // ), - // SizedBox( - // width: popUpButtonWidth, - // height: 50, - // child: MIHButton( - // onTap: () { - // updateAccessAPICall(index, "approved"); - // }, - // buttonText: "Approve", - // buttonColor: MzanziInnovationHub.of(context)! - // .theme - // .successColor(), - // 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, - // ), - // ), - // ), - // ], - // ), - // ), - // ); } @override diff --git a/Frontend/lib/mih_packages/access_review/builder/build_business_access_list.dart b/Frontend/lib/mih_packages/access_review/builder/build_business_access_list.dart index edd1cc2d..4d2c2d07 100644 --- a/Frontend/lib/mih_packages/access_review/builder/build_business_access_list.dart +++ b/Frontend/lib/mih_packages/access_review/builder/build_business_access_list.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_api_calls.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; @@ -37,41 +37,6 @@ class _BuildPatientsListState extends State { late double width; late double height; - // Future updateAccessAPICall(int index, String accessType) async { - // var response = await http.put( - // Uri.parse("$baseAPI/access-requests/update/"), - // headers: { - // "Content-Type": "application/json; charset=UTF-8" - // }, - // body: jsonEncode({ - // "business_id": widget.patientAccessList[index].business_id, - // "app_id": widget.patientAccessList[index].app_id, - // "date_time": widget.patientAccessList[index].date_time, - // "access": accessType, - // }), - // ); - // if (response.statusCode == 200) { - // //Navigator.of(context).pushNamed('/home'); - // Navigator.of(context).pop(); - // Navigator.of(context).pop(); - // Navigator.of(context).pushNamed( - // '/patient-access-review', - // arguments: widget.signedInUser, - // ); - // String message = ""; - // if (accessType == "approved") { - // message = - // "You've successfully approved the access request! ${widget.patientAccessList[index].Name} now has access to your profile until ${widget.patientAccessList[index].revoke_date.substring(0, 16).replaceAll("T", " ")}."; - // } else { - // message = - // "You've declined the access request. ${widget.patientAccessList[index].Name} will not have access to your profile."; - // } - // successPopUp(message); - // } else { - // internetConnectionPopUp(); - // } - // } - void internetConnectionPopUp() { showDialog( context: context, @@ -377,55 +342,60 @@ class _BuildPatientsListState extends State { runSpacing: 10, spacing: 10, children: [ - SizedBox( - width: popUpButtonWidth, - height: 50, - child: MIHButton( - onTap: () { - print("request declined"); - MIHApiCalls.updatePatientAccessAPICall( - widget.patientAccessList[index].business_id, - widget.patientAccessList[index].requested_by, - widget.patientAccessList[index].app_id, - "declined", - "${widget.signedInUser.fname} ${widget.signedInUser.lname}", - widget.signedInUser, - context, - ); - //updateAccessAPICall(index, "declined"); - }, - buttonText: "Decline", - buttonColor: - MzanziInnovationHub.of(context)!.theme.errorColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + MihButton( + onPressed: () { + print("request declined"); + MIHApiCalls.updatePatientAccessAPICall( + widget.patientAccessList[index].business_id, + widget.patientAccessList[index].requested_by, + widget.patientAccessList[index].app_id, + "declined", + "${widget.signedInUser.fname} ${widget.signedInUser.lname}", + widget.signedInUser, + context, + ); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 300, + child: Text( + "Decline", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), - SizedBox( - width: popUpButtonWidth, - height: 50, - child: MIHButton( - onTap: () { - print("request approved"); - MIHApiCalls.updatePatientAccessAPICall( - widget.patientAccessList[index].business_id, - widget.patientAccessList[index].requested_by, - widget.patientAccessList[index].app_id, - "approved", - "${widget.signedInUser.fname} ${widget.signedInUser.lname}", - widget.signedInUser, - context, - ); - //updateAccessAPICall(index, "approved"); - }, - buttonText: "Approve", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .successColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + MihButton( + onPressed: () { + print("request approved"); + MIHApiCalls.updatePatientAccessAPICall( + widget.patientAccessList[index].business_id, + widget.patientAccessList[index].requested_by, + widget.patientAccessList[index].app_id, + "approved", + "${widget.signedInUser.fname} ${widget.signedInUser.lname}", + widget.signedInUser, + context, + ); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 300, + child: Text( + "Approve", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/authentication/biometric_check.dart b/Frontend/lib/mih_packages/authentication/biometric_check.dart index e424852a..ffe4f403 100644 --- a/Frontend/lib/mih_packages/authentication/biometric_check.dart +++ b/Frontend/lib/mih_packages/authentication/biometric_check.dart @@ -1,9 +1,9 @@ import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart'; import 'package:mzansi_innovation_hub/mih_packages/mih_home/mih_profile_getter.dart'; @@ -114,6 +114,7 @@ class _BiometricCheckState extends State { ), alertTitle: "Biometric Authentication Error", alertBody: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ Text( "Hi there! To jump into the MIH Home Package, you'll need to authenticate yourself with your phones biometrics, please set up biometric authentication (like fingerprint, face ID, pattern or pin) on your device first.\n\nIf you have already set up biometric authentication, press \"Authenticate now\" to try again or press \"Set Up Authentication\" to go to your device settings.", @@ -124,38 +125,51 @@ class _BiometricCheckState extends State { ), const SizedBox(height: 20), Wrap( + runAlignment: WrapAlignment.center, + crossAxisAlignment: WrapCrossAlignment.center, + spacing: 10, + runSpacing: 10, children: [ - SizedBox( + MihButton( + onPressed: () { + AppSettings.openAppSettings( + type: AppSettingsType.security, + ); + Navigator.of(context).pop(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), width: 300, - child: MIHButton( - onTap: () { - AppSettings.openAppSettings( - type: AppSettingsType.security, - ); - Navigator.of(context).pop(); - }, - buttonText: "Set Up Authentication", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Set Up Authentication", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + MihButton( + onPressed: () { + Navigator.of(context).pop(); + authenticateUser(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Authenticate Now", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], ), - SizedBox( - width: 300, - child: MIHButton( - onTap: () { - Navigator.of(context).pop(); - authenticateUser(); - }, - buttonText: "Authenticate Now", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - ), - ) ], ), alertColour: MzanziInnovationHub.of(context)!.theme.errorColor(), @@ -209,32 +223,22 @@ class _BiometricCheckState extends State { color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), ), - // if (_isBioAuthenticated) - // Icon( - // Icons.lock_open, - // size: 200, - // color: MzanziInnovationHub.of(context)! - // .theme - // .secondaryColor(), - // ), const SizedBox(height: 30), - Container( - alignment: Alignment.bottomCenter, - child: SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Authenticate Now", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! + MihButton( + onPressed: () { + authenticateUser(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Authenticate Now", + style: TextStyle( + color: MzanziInnovationHub.of(context)! .theme .primaryColor(), - onTap: () async { - //Check Biometrics - authenticateUser(); - }, + fontSize: 20, + fontWeight: FontWeight.bold, ), ), ), diff --git a/Frontend/lib/mih_packages/authentication/forgot_password.dart b/Frontend/lib/mih_packages/authentication/forgot_password.dart index f81bb425..0b267854 100644 --- a/Frontend/lib/mih_packages/authentication/forgot_password.dart +++ b/Frontend/lib/mih_packages/authentication/forgot_password.dart @@ -2,10 +2,10 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; import '../../main.dart'; import 'package:supertokens_flutter/http.dart' as http; - -import '../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import '../../mih_components/mih_layout/mih_action.dart'; import '../../mih_components/mih_layout/mih_body.dart'; @@ -86,102 +86,53 @@ class _ForgotPasswordState extends State { showDialog( context: context, builder: (context) { - return Dialog( - child: Stack( + return MihPackageAlert( + alertIcon: Icon( + Icons.warning_amber_rounded, + size: 100, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + alertTitle: "Password Reset Confirmation", + alertBody: Column( + //mainAxisSize: MainAxisSize.max, children: [ - Container( - padding: const EdgeInsets.all(10.0), - width: 500.0, - height: 450, - 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.max, - children: [ - Icon( - Icons.warning_amber_rounded, - size: 100, - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - ), - const SizedBox(height: 15), - Text( - " Password Reset Confirmation", - textAlign: TextAlign.center, - style: TextStyle( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - fontSize: 25.0, - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 15), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: Text( - "Before you reset your password, please be aware that you'll receive an email with a link to confirm your identity and set a new password. Make sure to check your inbox, including spam or junk folders. If you don't receive the email within a few minutes, please try resending the reset request.", - style: TextStyle( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 25), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Continue", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () { - setState(() { - acceptWarning = true; - }); - Navigator.of(context).pop(); - validateInput(); - }, - ), - ), - ], + Padding( + padding: const EdgeInsets.symmetric(horizontal: 25.0), + child: Text( + "Before you reset your password, please be aware that you'll receive an email with a link to confirm your identity and set a new password. Make sure to check your inbox, including spam or junk folders. If you don't receive the email within a few minutes, please try resending the reset request.", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: 15.0, + fontWeight: FontWeight.bold, ), ), ), - 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, + const SizedBox(height: 25), + MihButton( + onPressed: () { + setState(() { + acceptWarning = true; + }); + Navigator.of(context).pop(); + validateInput(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Continue", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, ), ), ), ], ), + alertColour: MzanziInnovationHub.of(context)!.theme.secondaryColor(), ); }, ); @@ -308,22 +259,24 @@ class _ForgotPasswordState extends State { ), //spacer - const SizedBox(height: 30), - // sign in button - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Reset Password", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () { - prePassResteWarning(); - }, + const SizedBox(height: 25), + MihButton( + onPressed: () { + prePassResteWarning(); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 300, + child: Text( + "Reset Password", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/authentication/register.dart b/Frontend/lib/mih_packages/authentication/register.dart index ae1af849..229bc938 100644 --- a/Frontend/lib/mih_packages/authentication/register.dart +++ b/Frontend/lib/mih_packages/authentication/register.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart'; import 'package:mzansi_innovation_hub/mih_objects/arguments.dart'; import 'package:flutter/material.dart'; @@ -10,7 +11,6 @@ import '../../main.dart'; import 'package:supertokens_flutter/http.dart' as http; import 'package:supertokens_flutter/supertokens.dart'; -import '../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../mih_components/mih_inputs_and_buttons/mih_pass_input.dart'; import '../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import '../../mih_components/mih_layout/mih_action.dart'; @@ -245,19 +245,23 @@ class _RegisterState extends State { child: MIHAction( icon: Padding( padding: const EdgeInsets.all(10.0), - child: SizedBox( - width: 150, - child: MIHButton( - onTap: () { - Navigator.of(context).pushNamed( - '/about', - arguments: 0, - ); - }, - buttonText: "Install MIH", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: MihButton( + onPressed: () { + Navigator.of(context).pushNamed( + '/about', + arguments: 0, + ); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Install MIH", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ), @@ -345,7 +349,7 @@ class _RegisterState extends State { const SizedBox(height: 10), //Heading Text( - 'Create a New Account', + 'Create an Account', style: TextStyle( fontSize: 25, fontWeight: FontWeight.bold, @@ -391,40 +395,28 @@ class _RegisterState extends State { ), ), //spacer - const SizedBox(height: 30), + const SizedBox(height: 25), // sign up button - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Create New Account", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .successColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () async { - validateInput(); - }, + MihButton( + onPressed: () { + validateInput(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Text( + "Create New Account", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), + const SizedBox(height: 10), - // SizedBox( - // width: 500.0, - // height: 50.0, - // child: MIHButton( - // buttonText: "Sign In", - // buttonColor: MzanziInnovationHub.of(context)! - // .theme - // .secondaryColor(), - // textColor: MzanziInnovationHub.of(context)! - // .theme - // .primaryColor(), - // onTap: widget.onTap, - // ), - // ), - // const SizedBox(height: 10), //register text SizedBox( width: 500.0, diff --git a/Frontend/lib/mih_packages/authentication/reset_password.dart b/Frontend/lib/mih_packages/authentication/reset_password.dart index 9a159f9f..d12f8ef7 100644 --- a/Frontend/lib/mih_packages/authentication/reset_password.dart +++ b/Frontend/lib/mih_packages/authentication/reset_password.dart @@ -2,10 +2,9 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import '../../main.dart'; import 'package:supertokens_flutter/http.dart' as http; - -import '../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../mih_components/mih_inputs_and_buttons/mih_pass_input.dart'; import '../../mih_components/mih_layout/mih_action.dart'; import '../../mih_components/mih_layout/mih_body.dart'; @@ -102,111 +101,6 @@ class _ResetPasswordState extends State { return MzanziInnovationHub.of(context)!.theme.primaryColor(); } - void prePassResteWarning() { - showDialog( - context: context, - builder: (context) { - return Dialog( - child: Stack( - children: [ - Container( - padding: const EdgeInsets.all(10.0), - width: 500.0, - height: 450, - 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.max, - children: [ - Icon( - Icons.warning_amber_rounded, - size: 100, - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - ), - const SizedBox(height: 15), - Text( - "Password Reset Confirmation", - textAlign: TextAlign.center, - style: TextStyle( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - fontSize: 25.0, - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 15), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: Text( - "Before you reset your password, please be aware that you'll receive an email with a link to confirm your identity and set a new password. Make sure to check your inbox, including spam or junk folders. If you don't receive the email within a few minutes, please try resending the reset request.", - style: TextStyle( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 25), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Continue", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () { - setState(() { - acceptWarning = true; - }); - Navigator.of(context).pop(); - validateInput(); - }, - ), - ), - ], - ), - ), - ), - 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, - ), - ), - ), - ], - ), - ); - }, - ); - } - void loginError() { showDialog( context: context, @@ -372,22 +266,25 @@ class _ResetPasswordState extends State { ), //spacer - const SizedBox(height: 30), + const SizedBox(height: 25), // sign in button - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Reset Password", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () { - validateInput(); - }, + MihButton( + onPressed: () { + validateInput(); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 300, + child: Text( + "Reset Password", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/authentication/signin.dart b/Frontend/lib/mih_packages/authentication/signin.dart index c495e032..85d01399 100644 --- a/Frontend/lib/mih_packages/authentication/signin.dart +++ b/Frontend/lib/mih_packages/authentication/signin.dart @@ -1,12 +1,11 @@ import 'dart:convert'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart'; import 'package:mzansi_innovation_hub/mih_objects/arguments.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import '../../main.dart'; import 'package:supertokens_flutter/http.dart' as http; - -import '../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../mih_components/mih_inputs_and_buttons/mih_pass_input.dart'; import '../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import '../../mih_components/mih_layout/mih_action.dart'; @@ -19,7 +18,7 @@ import '../../mih_components/mih_pop_up_messages/mih_loading_circle.dart'; import '../../mih_env/env.dart'; class SignIn extends StatefulWidget { - final Function()? onTap; + final Function() onTap; const SignIn({super.key, required this.onTap}); @override @@ -292,19 +291,23 @@ class _SignInState extends State { child: MIHAction( icon: Padding( padding: const EdgeInsets.all(10.0), - child: SizedBox( - width: 150, - child: MIHButton( - onTap: () { - Navigator.of(context).pushNamed( - '/about', - arguments: 0, - ); - }, - buttonText: "Install MIH", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: MihButton( + onPressed: () { + Navigator.of(context).pushNamed( + '/about', + arguments: 0, + ); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Install MIH", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ), @@ -486,36 +489,41 @@ class _SignInState extends State { //spacer const SizedBox(height: 30), // sign in button - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Sign In", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () async { - validateInput(); - }, + MihButton( + onPressed: () { + validateInput(); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 300, + child: Text( + "Sign In", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), - //spacer const SizedBox(height: 10), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Create New Account", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .successColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: widget.onTap, + MihButton( + onPressed: widget.onTap, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .successColor(), + width: 300, + child: Text( + "Create New Account", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), //spacer diff --git a/Frontend/lib/mih_packages/calculator/package_tools/simple_calc.dart b/Frontend/lib/mih_packages/calculator/package_tools/simple_calc.dart index 90e1f115..cbf667c2 100644 --- a/Frontend/lib/mih_packages/calculator/package_tools/simple_calc.dart +++ b/Frontend/lib/mih_packages/calculator/package_tools/simple_calc.dart @@ -1,6 +1,6 @@ import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:flutter/material.dart'; import 'package:math_expressions/math_expressions.dart'; @@ -162,18 +162,27 @@ class _SimpleCalcState extends State { if (index == 0) { return Padding( padding: const EdgeInsets.all(4.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { setState(() { userInput = ''; answer = '0'; }); }, - buttonText: buttons[index], - buttonColor: Color.fromRGBO(214, 171, 255, 1), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + buttonColor: const Color.fromRGBO(214, 171, 255, 1), + width: 50, + height: 50, + borderRadius: 5, + child: Text( + buttons[index], + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ); } @@ -182,19 +191,28 @@ class _SimpleCalcState extends State { else if (index == 1) { return Padding( padding: const EdgeInsets.all(4.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { setState(() { userInput += buttons[index]; }); }, - buttonText: buttons[index], buttonColor: MzanziInnovationHub.of(context)! .theme .messageTextColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + width: 50, + height: 50, + borderRadius: 5, + child: Text( + buttons[index], + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ); } @@ -202,19 +220,28 @@ class _SimpleCalcState extends State { else if (index == 2) { return Padding( padding: const EdgeInsets.all(4.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { setState(() { userInput += buttons[index]; }); }, - buttonText: buttons[index], buttonColor: MzanziInnovationHub.of(context)! .theme .messageTextColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + width: 50, + height: 50, + borderRadius: 5, + child: Text( + buttons[index], + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ); } @@ -225,8 +252,8 @@ class _SimpleCalcState extends State { index == 15) { return Padding( padding: const EdgeInsets.all(4.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { if (answer == "0") { setState(() { userInput += buttons[index]; @@ -238,17 +265,23 @@ class _SimpleCalcState extends State { userInput += buttons[index]; }); } - // setState(() { - // userInput += buttons[index]; - // }); }, - buttonText: buttons[index], buttonColor: MzanziInnovationHub.of(context)! .theme .messageTextColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + width: 50, + height: 50, + borderRadius: 5, + child: Text( + buttons[index], + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ); } @@ -257,8 +290,8 @@ class _SimpleCalcState extends State { else if (index == 18) { return Padding( padding: const EdgeInsets.all(4.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { setState(() { if (userInput.length == 1) { userInput = '0'; @@ -270,17 +303,20 @@ class _SimpleCalcState extends State { userInput = userInput.substring(0, userInput.length - 1); } - // userInput = - // userInput.substring(0, userInput.length - 1); equalPressed(); }); }, - buttonText: buttons[index], buttonColor: MzanziInnovationHub.of(context)!.theme.errorColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + width: 50, + height: 50, + borderRadius: 5, + child: Icon( + Icons.backspace, + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + ), ), ); } @@ -288,20 +324,29 @@ class _SimpleCalcState extends State { else if (index == 19) { return Padding( padding: const EdgeInsets.all(4.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { setState(() { equalPressed(); userInput = answer; }); }, - buttonText: buttons[index], buttonColor: MzanziInnovationHub.of(context)! .theme .successColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + width: 50, + height: 50, + borderRadius: 5, + child: Text( + buttons[index], + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ); } @@ -309,20 +354,29 @@ class _SimpleCalcState extends State { else { return Padding( padding: const EdgeInsets.all(4.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { setState(() { userInput += buttons[index]; equalPressed(); }); }, - buttonText: buttons[index], buttonColor: MzanziInnovationHub.of(context)! .theme .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), + width: 50, + height: 50, + borderRadius: 5, + child: Text( + buttons[index], + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ); } diff --git a/Frontend/lib/mih_packages/calculator/package_tools/tip_calc.dart b/Frontend/lib/mih_packages/calculator/package_tools/tip_calc.dart index 894c03b4..a15aacf5 100644 --- a/Frontend/lib/mih_packages/calculator/package_tools/tip_calc.dart +++ b/Frontend/lib/mih_packages/calculator/package_tools/tip_calc.dart @@ -1,8 +1,8 @@ import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; @@ -330,31 +330,45 @@ class _TipCalcState extends State { ); }, ), - SizedBox( - width: double.infinity, - height: 50, - child: MIHButton( - onTap: () { - validateInput(); - }, - buttonText: "Calculate", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - ), - ), - const SizedBox(height: 10), - SizedBox( - width: double.infinity, - height: 50, - child: MIHButton( - onTap: () { - clearInput(); - }, - buttonText: "Clear", - buttonColor: MzanziInnovationHub.of(context)!.theme.errorColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - ), + Wrap( + spacing: 10, + runSpacing: 10, + children: [ + MihButton( + onPressed: () { + validateInput(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Text( + "Calculate", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + MihButton( + onPressed: () { + clearInput(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 300, + child: Text( + "Clear", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), ], ), diff --git a/Frontend/lib/mih_packages/calendar/builder/build_access_request_list.dart b/Frontend/lib/mih_packages/calendar/builder/build_access_request_list.dart index eee3300e..5e26c340 100644 --- a/Frontend/lib/mih_packages/calendar/builder/build_access_request_list.dart +++ b/Frontend/lib/mih_packages/calendar/builder/build_access_request_list.dart @@ -1,12 +1,12 @@ import 'dart:convert'; import 'package:flutter/material.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:supertokens_flutter/http.dart' as http; import '../../../main.dart'; -import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../../mih_components/mih_pop_up_messages/mih_error_message.dart'; import '../../../mih_components/mih_pop_up_messages/mih_success_message.dart'; import '../../../mih_components/mih_pop_up_messages/mih_warning_message.dart'; @@ -246,32 +246,40 @@ class _BuildPatientsListState extends State { runSpacing: 10, spacing: 10, children: [ - SizedBox( - width: popUpButtonWidth, - height: 50, - child: MIHButton( - onTap: () { - updateAccessAPICall(index, "declined"); - }, - buttonText: "Decline", - buttonColor: - MzanziInnovationHub.of(context)!.theme.errorColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + updateAccessAPICall(index, "declined"); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 300, + child: Text( + "Decline", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), - SizedBox( - width: popUpButtonWidth, - height: 50, - child: MIHButton( - onTap: () { - updateAccessAPICall(index, "approved"); - }, - buttonText: "Approve", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + updateAccessAPICall(index, "approved"); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Text( + "Approve", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/calendar/builder/build_appointment_list.dart b/Frontend/lib/mih_packages/calendar/builder/build_appointment_list.dart index b54b80f6..63070957 100644 --- a/Frontend/lib/mih_packages/calendar/builder/build_appointment_list.dart +++ b/Frontend/lib/mih_packages/calendar/builder/build_appointment_list.dart @@ -1,11 +1,11 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_calendar_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_multiline_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; @@ -428,18 +428,22 @@ class _BuildAppointmentListState extends State { runSpacing: 10, spacing: 10, children: [ - SizedBox( - width: 500, - height: 50, - child: MIHButton( - onTap: () { - updateAppointmentCall(index); - }, - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + updateAppointmentCall(index); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/calendar/package_tools/appointments.dart b/Frontend/lib/mih_packages/calendar/package_tools/appointments.dart index b48460e1..fd71df61 100644 --- a/Frontend/lib/mih_packages/calendar/package_tools/appointments.dart +++ b/Frontend/lib/mih_packages/calendar/package_tools/appointments.dart @@ -1,11 +1,11 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_calendar_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_multiline_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; @@ -152,18 +152,21 @@ class _PatientAccessRequestState extends State { ), ), const SizedBox(height: 20), - SizedBox( - width: 500, - height: 50, - child: MIHButton( - onTap: () { - addAppointmentCall(); - }, - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + addAppointmentCall(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Text( + "Add", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mih_home/mih_profile_getter.dart b/Frontend/lib/mih_packages/mih_home/mih_profile_getter.dart index 693f9365..fe037f96 100644 --- a/Frontend/lib/mih_packages/mih_home/mih_profile_getter.dart +++ b/Frontend/lib/mih_packages/mih_home/mih_profile_getter.dart @@ -1,5 +1,5 @@ import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_action.dart'; @@ -116,14 +116,21 @@ class _MIHProfileGetterState extends State { ), ), const SizedBox(height: 15), - MIHButton( - onTap: () { + MihButton( + onPressed: () { Navigator.of(context).popAndPushNamed("/"); }, - buttonText: "Refresh", buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Text( + "Refresh", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), const SizedBox(height: 15), Padding( diff --git a/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_employee_list.dart b/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_employee_list.dart index 64ce3ff0..ee7cd38d 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_employee_list.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_employee_list.dart @@ -2,9 +2,9 @@ import 'dart:convert'; import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; @@ -211,29 +211,31 @@ class _BuildEmployeeListState extends State { enableSearch: false, ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () { + if (isRequiredFieldsCaptured()) { + updateEmployeeAPICall(index); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - if (isRequiredFieldsCaptured()) { - updateEmployeeAPICall(index); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ), ), diff --git a/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_user_list.dart b/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_user_list.dart index 866de8dd..14d0998a 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_user_list.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/business_profile/builders/build_user_list.dart @@ -1,9 +1,9 @@ import 'dart:convert'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart'; @@ -162,28 +162,31 @@ class _BuildUserListState extends State { enableSearch: false, ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () { + if (isRequiredFieldsCaptured()) { + createBusinessUserAPICall(index); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage( + errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - if (isRequiredFieldsCaptured()) { - createBusinessUserAPICall(index); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage( - errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Add", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), const SizedBox(height: 10.0), diff --git a/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_details.dart b/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_details.dart index f367f157..998b021c 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_details.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_details.dart @@ -4,9 +4,9 @@ import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_business_details_apis.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_location_api.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart'; @@ -337,41 +337,45 @@ class _MihBusinessDetailsState extends State { ), ), const SizedBox(width: 10.0), - SizedBox( - width: 100.0, - height: 50.0, - child: MIHButton( - buttonText: "Set", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - MIHLocationAPI().getGPSPosition(context).then((position) { - if (position != null) { - setState(() { - locationController.text = - "${position.latitude}, ${position.longitude}"; - }); - } - }); - }, + MihButton( + onPressed: () { + MIHLocationAPI().getGPSPosition(context).then((position) { + if (position != null) { + setState(() { + locationController.text = + "${position.latitude}, ${position.longitude}"; + }); + } + }); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 100, + child: Text( + "Set", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], ), const SizedBox(height: 15), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - submitForm(); - }, + MihButton( + onPressed: () { + submitForm(); + }, + buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_profile.dart b/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_profile.dart deleted file mode 100644 index f126e78e..00000000 --- a/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_profile.dart +++ /dev/null @@ -1,595 +0,0 @@ -import 'dart:convert'; - -import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart'; -import 'package:mzansi_innovation_hub/mih_apis/mih_location_api.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_file_input.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; -import 'package:mzansi_innovation_hub/mih_env/env.dart'; -import 'package:mzansi_innovation_hub/mih_objects/arguments.dart'; -import 'package:file_picker/file_picker.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:supertokens_flutter/http.dart' as http; - -class MihBusinessProfile extends StatefulWidget { - final BusinessArguments arguments; - const MihBusinessProfile({ - super.key, - required this.arguments, - }); - - @override - State createState() => _MihBusinessProfileState(); -} - -class _MihBusinessProfileState extends State { - final FocusNode _focusNode = FocusNode(); - final baseAPI = AppEnviroment.baseApiUrl; - - final nameController = TextEditingController(); - final typeController = TextEditingController(); - final regController = TextEditingController(); - final logonameController = TextEditingController(); - final fnameController = TextEditingController(); - final lnameController = TextEditingController(); - final titleController = TextEditingController(); - final signtureController = TextEditingController(); - final accessController = TextEditingController(); - final contactController = TextEditingController(); - final emailController = TextEditingController(); - final locationController = TextEditingController(); - final practiceNoController = TextEditingController(); - final vatNoController = TextEditingController(); - - late PlatformFile? selectedLogo = null; - late PlatformFile? selectedSignature = null; - PlatformFile? logoFile; - ImageProvider? logoPreview = null; - - final ValueNotifier busType = ValueNotifier(""); - - late String business_id; - late String oldLogoPath; - late String oldSigPath; - String logoUri = ""; - late String env; - - Future updateBusinessProfileAPICall(String business_id) async { - print("inside update business profile api call"); - showDialog( - context: context, - builder: (context) { - return const Mihloadingcircle(); - }, - ); - var response = await http.put( - Uri.parse("$baseAPI/business/update/"), - headers: { - "Content-Type": "application/json; charset=UTF-8" - }, - body: jsonEncode({ - "business_id": business_id, - "Name": nameController.text, - "type": typeController.text, - "registration_no": regController.text, - "logo_name": logonameController.text, - "logo_path": - "${widget.arguments.signedInUser.app_id}/business_files/${logonameController.text}", - "contact_no": contactController.text, - "bus_email": emailController.text, - "gps_location": locationController.text, - "practice_no": practiceNoController.text, - "vat_no": vatNoController.text, - }), - ); - if (response.statusCode == 200) { - //var businessResponse = jsonDecode(response.body); - //print(selectedLogo != null); - if (logoFile != null) { - uploadSelectedFile(logoFile); - } - updateBusinessUserAPICall(business_id); - } else { - internetConnectionPopUp(); - } - } - - Future updateBusinessUserAPICall(String business_id) async { - var response = await http.put( - Uri.parse("$baseAPI/business-user/update/"), - headers: { - "Content-Type": "application/json; charset=UTF-8" - }, - body: jsonEncode({ - "business_id": business_id, - "app_id": widget.arguments.signedInUser.app_id, - "signature": signtureController.text, - "sig_path": - "${widget.arguments.signedInUser.app_id}/business_files/${signtureController.text}", - "title": titleController.text, - "access": accessController.text, - }), - ); - if (response.statusCode == 200) { - if (selectedSignature != null) { - uploadSelectedFile(selectedSignature); - deleteFileApiCall(oldSigPath); - } - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pushNamed( - '/', - arguments: AuthArguments( - false, - false, - ), - ); - String message = - "Your business profile is now live! You can now start connecting with customers and growing your business."; - successPopUp(message); - } else { - internetConnectionPopUp(); - } - } - - Future uploadSelectedFile(PlatformFile? file) async { - print("Inside upload selected file"); - var response = await MihFileApi.uploadFile( - widget.arguments.signedInUser.app_id, - env, - "business_files", - file, - context, - ); - if (response == 200) { - deleteFileApiCall(oldLogoPath); - } else { - internetConnectionPopUp(); - } - } - - Future deleteFileApiCall(String filePath) async { - // delete file from minio - var response = await MihFileApi.deleteFile( - widget.arguments.signedInUser.app_id, - env, - "business_files", - filePath.split("/").last, - context, - ); - if (response == 200) { - //SQL delete - } else { - internetConnectionPopUp(); - } - } - - bool isFullAccess() { - if (widget.arguments.businessUser!.access == "Partial") { - return false; - } else { - return true; - } - } - - bool validEmail() { - String text = emailController.text; - var regex = RegExp(r'^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$'); - return regex.hasMatch(text); - } - - bool isFieldsFilled() { - if (nameController.text.isEmpty || - typeController.text.isEmpty || - regController.text.isEmpty || - logonameController.text.isEmpty || - fnameController.text.isEmpty || - lnameController.text.isEmpty || - titleController.text.isEmpty || - signtureController.text.isEmpty || - accessController.text.isEmpty || - contactController.text.isEmpty || - emailController.text.isEmpty) { - return false; - } else { - return true; - } - } - - void typeSelected() { - if (typeController.text.isNotEmpty) { - busType.value = typeController.text; - } else { - busType.value = ""; - } - } - - void submitForm(String business_id) { - if (!validEmail()) { - emailError(); - } else if (isFieldsFilled()) { - print("inside submit form mthod"); - updateBusinessProfileAPICall(business_id); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - } - - void successPopUp(String message) { - showDialog( - context: context, - builder: (context) { - return MIHSuccessMessage( - successType: "Success", - successMessage: message, - ); - }, - ); - } - - void emailError() { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Invalid Email"); - }, - ); - } - - void internetConnectionPopUp() { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Internet Connection"); - }, - ); - } - - @override - void dispose() { - nameController.dispose(); - typeController.dispose(); - regController.dispose(); - logonameController.dispose(); - fnameController.dispose(); - lnameController.dispose(); - titleController.dispose(); - signtureController.dispose(); - accessController.dispose(); - contactController.dispose(); - emailController.dispose(); - locationController.dispose(); - practiceNoController.dispose(); - vatNoController.dispose(); - _focusNode.dispose(); - super.dispose(); - } - - @override - void initState() { - typeController.addListener(typeSelected); - setState(() { - titleController.text = widget.arguments.businessUser!.title; - fnameController.text = widget.arguments.signedInUser.fname; - lnameController.text = widget.arguments.signedInUser.lname; - signtureController.text = widget.arguments.businessUser!.signature; - titleController.text = widget.arguments.businessUser!.title; - accessController.text = widget.arguments.businessUser!.access; - oldSigPath = widget.arguments.businessUser!.sig_path; - business_id = widget.arguments.business!.business_id; - regController.text = widget.arguments.business!.registration_no; - nameController.text = widget.arguments.business!.Name; - typeController.text = widget.arguments.business!.type; - logonameController.text = widget.arguments.business!.logo_name; - oldLogoPath = widget.arguments.business!.logo_path; - contactController.text = widget.arguments.business!.contact_no; - emailController.text = widget.arguments.business!.bus_email; - locationController.text = widget.arguments.business!.gps_location; - practiceNoController.text = widget.arguments.business!.practice_no; - vatNoController.text = widget.arguments.business!.vat_no; - }); - MihFileApi.getMinioFileUrl( - widget.arguments.business!.logo_path, - context, - ).then((value) { - setState(() { - logoUri = value; - }); - logoPreview = NetworkImage(logoUri); - }); - if (AppEnviroment.getEnv() == "Prod") { - env = "Prod"; - } else { - env = "Dev"; - } - super.initState(); - } - - @override - Widget build(BuildContext context) { - return MihPackageToolBody( - borderOn: true, - bodyItem: getBody(), - ); - } - - Widget getBody() { - return MihSingleChildScroll( - child: KeyboardListener( - focusNode: _focusNode, - autofocus: true, - onKeyEvent: (event) async { - if (event is KeyDownEvent && - event.logicalKey == LogicalKeyboardKey.enter) { - //print(business_id); - submitForm(business_id); - } - }, - child: Column( - children: [ - Visibility( - visible: isFullAccess(), - child: Column( - children: [ - const Text( - "Business Profile", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 25, - ), - ), - Divider( - color: MzanziInnovationHub.of(context) - ?.theme - .secondaryColor()), - const SizedBox(height: 10.0), - MihCircleAvatar( - imageFile: logoPreview, - fileNameController: logonameController, - userSelectedfile: logoFile, - width: 155, - editable: true, - frameColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - onChange: (newProPic) { - setState(() { - logoFile = newProPic; - }); - print("logoFile: ${logoFile?.bytes}"); - }, - backgroundColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), - const SizedBox(height: 10.0), - MIHFileField( - controller: logonameController, - hintText: "Logo", - editable: false, - required: true, - onPressed: () async { - FilePickerResult? result = - await FilePicker.platform.pickFiles( - type: FileType.custom, - allowedExtensions: ['jpg', 'png'], - ); - if (result == null) return; - final selectedFile = result.files.first; - setState(() { - selectedLogo = selectedFile; - }); - setState(() { - logonameController.text = selectedFile.name; - }); - }, - ), - const SizedBox(height: 10.0), - MIHTextField( - controller: regController, - hintText: "Registration No.", - editable: true, - required: true, - ), - const SizedBox(height: 10.0), - MIHTextField( - controller: nameController, - hintText: "Business Name", - editable: true, - required: true, - ), - const SizedBox(height: 10.0), - MIHDropdownField( - controller: typeController, - hintText: "Business Type", - dropdownOptions: const ["Doctors Office", "Other"], - required: true, - editable: true, - enableSearch: false, - ), - const SizedBox(height: 10.0), - ValueListenableBuilder( - valueListenable: busType, - builder: - (BuildContext context, String value, Widget? child) { - return Visibility( - visible: value == "Doctors Office", - child: MIHTextField( - controller: practiceNoController, - hintText: "Practice Number", - editable: true, - required: true, - ), - ); - }, - ), - const SizedBox(height: 10.0), - MIHTextField( - controller: vatNoController, - hintText: "VAT Number", - editable: true, - required: true, - ), - const SizedBox(height: 10.0), - MIHTextField( - controller: contactController, - hintText: "Contact Number", - editable: true, - required: true, - ), - const SizedBox(height: 10.0), - MIHTextField( - controller: emailController, - hintText: "Email", - editable: true, - required: true, - ), - const SizedBox(height: 10.0), - Row( - children: [ - Flexible( - child: MIHTextField( - controller: locationController, - hintText: "Location", - editable: false, - required: false, - ), - ), - const SizedBox(width: 10.0), - SizedBox( - width: 100.0, - height: 50.0, - child: MIHButton( - buttonText: "Set", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () { - MIHLocationAPI() - .getGPSPosition(context) - .then((position) { - if (position != null) { - setState(() { - locationController.text = - "${position.latitude}, ${position.longitude}"; - }); - } - }); - }, - ), - ), - ], - ), - const SizedBox(height: 15.0), - ], - ), - ), - Column( - children: [ - //const SizedBox(height: 15.0), - const Text( - "My Business User", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 25, - ), - ), - Divider( - color: - MzanziInnovationHub.of(context)?.theme.secondaryColor(), - ), - const SizedBox(height: 10.0), - MIHDropdownField( - controller: titleController, - hintText: "Title", - dropdownOptions: const ["Doctor", "Assistant", "Other"], - required: true, - editable: true, - enableSearch: false, - ), - const SizedBox(height: 10.0), - MIHTextField( - controller: fnameController, - hintText: "Name", - editable: false, - required: true, - ), - const SizedBox(height: 10.0), - MIHTextField( - controller: lnameController, - hintText: "Surname", - editable: false, - required: true, - ), - const SizedBox(height: 10.0), - MIHFileField( - controller: signtureController, - hintText: "Signature", - editable: false, - required: true, - onPressed: () async { - FilePickerResult? result = - await FilePicker.platform.pickFiles( - type: FileType.custom, - allowedExtensions: ['jpg', 'png', 'pdf'], - ); - if (result == null) return; - final selectedFile = result.files.first; - setState(() { - selectedSignature = selectedFile; - }); - setState(() { - signtureController.text = selectedFile.name; - }); - }, - ), - const SizedBox(height: 15.0), - MIHDropdownField( - controller: accessController, - hintText: "Access", - dropdownOptions: const ["Full", "Partial"], - required: true, - editable: false, - enableSearch: false, - ), - const SizedBox(height: 30.0), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - //print(business_id); - print("submit form call"); - submitForm(business_id); - }, - ), - ), - ], - ), - ], - ), - ), - ); - } -} diff --git a/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_my_business_user.dart b/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_my_business_user.dart index 7ad810e6..76afd97d 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_my_business_user.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/business_profile/package_tools/mih_my_business_user.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_my_business_user_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart'; @@ -318,17 +318,20 @@ class _MihMyBusinessUserState extends State { ), ), const SizedBox(height: 15), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - submitForm(); - }, + MihButton( + onPressed: () { + submitForm(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_profile/business_profile/profile_business_add.dart b/Frontend/lib/mih_packages/mzansi_profile/business_profile/profile_business_add.dart index 61ee7ce0..17b48760 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/business_profile/profile_business_add.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/business_profile/profile_business_add.dart @@ -6,13 +6,13 @@ import 'package:mzansi_innovation_hub/mih_apis/mih_business_details_apis.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_location_api.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_my_business_user_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart'; @@ -452,29 +452,32 @@ class _ProfileBusinessAddState extends State { ), ), const SizedBox(width: 10.0), - SizedBox( - width: 80.0, - height: 50.0, - child: MIHButton( - buttonText: "Set", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () { - MIHLocationAPI() - .getGPSPosition(context) - .then((position) { - if (position != null) { - setState(() { - locationController.text = - "${position.latitude}, ${position.longitude}"; - }); - } - }); - }, + MihButton( + onPressed: () { + MIHLocationAPI() + .getGPSPosition(context) + .then((position) { + if (position != null) { + setState(() { + locationController.text = + "${position.latitude}, ${position.longitude}"; + }); + } + }); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 100, + child: Text( + "Set", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], @@ -520,60 +523,6 @@ class _ProfileBusinessAddState extends State { editable: false, required: true, ), - const SizedBox(height: 10.0), - // const SizedBox(height: 10), - // Container( - // width: 300, - // alignment: Alignment.topLeft, - // child: const Text( - // "Signature:", - // style: TextStyle( - // fontSize: 15, - // fontWeight: FontWeight.bold, - // ), - // ), - // ), - // MihImageDisplay( - // imageFile: signaturePreview, - // width: 300, - // editable: true, - // fileNameController: signtureController, - // userSelectedfile: selectedSignature, - // onChange: (selectedFile) { - // setState(() { - // selectedSignature = selectedFile; - // }); - // }, - // ), - // const SizedBox(height: 10.0), - // MIHTextField( - // controller: signtureController, - // hintText: "Selected Signature File Name", - // editable: false, - // required: true, - // ), - const SizedBox(height: 10.0), - // MIHFileField( - // controller: signtureController, - // hintText: "Signature", - // editable: false, - // required: true, - // onPressed: () async { - // FilePickerResult? result = - // await FilePicker.platform.pickFiles( - // type: FileType.custom, - // allowedExtensions: ['jpg', 'png', 'pdf'], - // ); - // if (result == null) return; - // final selectedFile = result.files.first; - // setState(() { - // selectedSignature = selectedFile; - // }); - // setState(() { - // signtureController.text = selectedFile.name; - // }); - // }, - // ), const SizedBox(height: 15.0), MIHDropdownField( controller: accessController, @@ -584,18 +533,21 @@ class _ProfileBusinessAddState extends State { enableSearch: false, ), const SizedBox(height: 30.0), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - submitForm(); - }, + MihButton( + onPressed: () { + submitForm(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Add", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_employee_list.dart b/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_employee_list.dart index 06faec2d..8e3d3e89 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_employee_list.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_employee_list.dart @@ -2,11 +2,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_speed_dial/flutter_speed_dial.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:supertokens_flutter/http.dart' as http; import '../../../../main.dart'; -import '../../../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../../../mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_delete_message.dart'; @@ -212,165 +212,35 @@ class _BuildEmployeeListState extends State { enableSearch: false, ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () { + if (isRequiredFieldsCaptured()) { + updateEmployeeAPICall(index); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - if (isRequiredFieldsCaptured()) { - updateEmployeeAPICall(index); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ), ), ); - // showDialog( - // context: context, - // barrierDismissible: false, - // builder: (context) => Dialog( - // child: Stack( - // children: [ - // Container( - // padding: const EdgeInsets.all(10.0), - // width: 700.0, - // //height: 475.0, - // 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( - // padding: const EdgeInsets.symmetric(horizontal: 10), - // child: Column( - // mainAxisSize: MainAxisSize.min, - // children: [ - // Text( - // "Employee Details", - // textAlign: TextAlign.center, - // style: TextStyle( - // color: MzanziInnovationHub.of(context)! - // .theme - // .secondaryColor(), - // fontSize: 35.0, - // fontWeight: FontWeight.bold, - // ), - // ), - // const SizedBox(height: 25.0), - // MIHTextField( - // controller: fnameController, - // hintText: "First Name", - // editable: false, - // required: true, - // ), - // const SizedBox(height: 10.0), - // MIHTextField( - // controller: lnameController, - // hintText: "Surname", - // editable: false, - // required: true, - // ), - // const SizedBox(height: 10.0), - // MIHDropdownField( - // controller: typeController, - // hintText: "Title", - // dropdownOptions: const ["Doctor", "Assistant"], - // required: true, - // editable: true, - // ), - // const SizedBox(height: 10.0), - // MIHDropdownField( - // controller: accessController, - // hintText: "Access", - // dropdownOptions: const ["Full", "Partial"], - // required: true, - // editable: true, - // ), - // const SizedBox(height: 30.0), - // SizedBox( - // width: 300, - // height: 50, - // child: MIHButton( - // buttonText: "Update", - // buttonColor: MzanziInnovationHub.of(context)! - // .theme - // .secondaryColor(), - // textColor: MzanziInnovationHub.of(context)! - // .theme - // .primaryColor(), - // onTap: () { - // if (isRequiredFieldsCaptured()) { - // updateEmployeeAPICall(index); - // } else { - // showDialog( - // context: context, - // builder: (context) { - // return const MIHErrorMessage( - // errorType: "Input Error"); - // }, - // ); - // } - // }, - // ), - // ) - // ], - // ), - // ), - // ), - // 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, - // ), - // ), - // ), - // Positioned( - // top: 5, - // left: 5, - // width: 50, - // height: 50, - // child: IconButton( - // onPressed: () { - // showDeleteWarning(index); - // }, - // icon: Icon( - // Icons.delete, - // color: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // size: 35, - // ), - // ), - // ), - // ], - // ), - // ), - // ); } void showDeleteWarning(int index) { diff --git a/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_user_list.dart b/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_user_list.dart index 67e5f3d6..c75547dd 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_user_list.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/manage_business/builder/build_user_list.dart @@ -1,11 +1,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:supertokens_flutter/http.dart' as http; import '../../../../main.dart'; -import '../../../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../../../mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_error_message.dart'; @@ -163,28 +163,31 @@ class _BuildUserListState extends State { enableSearch: false, ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () { + if (isRequiredFieldsCaptured()) { + createBusinessUserAPICall(index); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage( + errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - if (isRequiredFieldsCaptured()) { - createBusinessUserAPICall(index); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage( - errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Add", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), const SizedBox(height: 10.0), diff --git a/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_about.dart b/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_about.dart index 4a55e123..de0e06a2 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_about.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_about.dart @@ -3,12 +3,11 @@ import 'dart:convert'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import '../../../main.dart'; import 'package:supertokens_flutter/http.dart' as http; import 'package:supertokens_flutter/supertokens.dart'; import 'package:http/http.dart' as http2; - -import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../../mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import '../../../mih_components/mih_inputs_and_buttons/mih_file_input.dart'; import '../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; @@ -514,20 +513,22 @@ class _BusinessAboutState extends State { // ), //const SizedBox(height: 15.0), const SizedBox(height: 30.0), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Update", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - //print(business_id); - submitForm(business_id); - }, + MihButton( + onPressed: () { + submitForm(business_id); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_details.dart b/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_details.dart index 16a02b9c..4bb52dd9 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_details.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/manage_business/business_details.dart @@ -3,13 +3,13 @@ import 'dart:convert'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import '../../../main.dart'; import 'package:supertokens_flutter/http.dart' as http; import 'package:supertokens_flutter/supertokens.dart'; import 'package:http/http.dart' as http2; import '../../../mih_apis/mih_location_api.dart'; -import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../../mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import '../../../mih_components/mih_inputs_and_buttons/mih_file_input.dart'; import '../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; @@ -442,29 +442,32 @@ class _BusinessDetailsState extends State { ), ), const SizedBox(width: 10.0), - SizedBox( - width: 80.0, - height: 50.0, - child: MIHButton( - buttonText: "Set", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () { - MIHLocationAPI() - .getGPSPosition(context) - .then((position) { - if (position != null) { - setState(() { - locationController.text = - "${position.latitude}, ${position.longitude}"; - }); - } - }); - }, + MihButton( + onPressed: () { + MIHLocationAPI() + .getGPSPosition(context) + .then((position) { + if (position != null) { + setState(() { + locationController.text = + "${position.latitude}, ${position.longitude}"; + }); + } + }); + }, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 100, + child: Text( + "Set", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], @@ -576,19 +579,21 @@ class _BusinessDetailsState extends State { // ), //const SizedBox(height: 15.0), const SizedBox(height: 30.0), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - //print(business_id); - submitForm(business_id); - }, + MihButton( + onPressed: () { + submitForm(business_id); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Add", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_profile.dart b/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_profile.dart index 69064c07..4e3fc410 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_profile.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_profile.dart @@ -3,10 +3,10 @@ import 'dart:convert'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_user_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_file_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart'; @@ -374,17 +374,20 @@ class _MihPersonalProfileState extends State { ], ), const SizedBox(height: 30.0), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - submitForm(); - }, + MihButton( + onPressed: () { + submitForm(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_settings.dart b/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_settings.dart index 12ca92c4..f4f2fb7a 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_settings.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_settings.dart @@ -1,7 +1,7 @@ import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_user_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; import 'package:mzansi_innovation_hub/mih_objects/app_user.dart'; @@ -55,33 +55,41 @@ class _MihPersonalSettingsState extends State { spacing: 10, runSpacing: 10, children: [ - SizedBox( + MihButton( + onPressed: () { + MihUserApis.deleteAccount( + widget.signedInUser.app_id, context); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.errorColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - MihUserApis.deleteAccount( - widget.signedInUser.app_id, context); - }, - buttonText: "Delete", - buttonColor: - MzanziInnovationHub.of(context)!.theme.errorColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Delete", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), - SizedBox( + MihButton( + onPressed: () { + Navigator.pop(context); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.errorColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - Navigator.pop(context); - }, - buttonText: "Cancel", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Cancel", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], @@ -135,18 +143,21 @@ class _MihPersonalSettingsState extends State { MzanziInnovationHub.of(context)!.theme.secondaryColor(), ), ), - SizedBox( - width: 300.0, - height: 50.0, - child: MIHButton( - buttonText: "Delete Account", - buttonColor: - MzanziInnovationHub.of(context)!.theme.errorColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - deleteAccountPopUp(context); - }, + MihButton( + onPressed: () { + deleteAccountPopUp(context); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Delete Account", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_wallet/builder/build_loyalty_card_list.dart b/Frontend/lib/mih_packages/mzansi_wallet/builder/build_loyalty_card_list.dart index 3923d080..8b3366df 100644 --- a/Frontend/lib/mih_packages/mzansi_wallet/builder/build_loyalty_card_list.dart +++ b/Frontend/lib/mih_packages/mzansi_wallet/builder/build_loyalty_card_list.dart @@ -1,9 +1,9 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_wallet_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart'; @@ -81,49 +81,58 @@ class _BuildLoyaltyCardListState extends State { ), ), const SizedBox(width: 10), - MIHButton( - onTap: () async { + MihButton( + onPressed: () { openscanner(); }, - buttonText: "Scan", buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + width: 100, + child: Text( + "Scan", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ], ), const SizedBox(height: 15), - SizedBox( + MihButton( + onPressed: () { + if (_cardNumberController.text == "") { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } else { + MIHMzansiWalletApis.updateLoyaltyCardAPICall( + widget.signedInUser, + widget.cardList[index].idloyalty_cards, + widget.cardList[index].favourite, + widget.cardList[index].priority_index, + _nicknameController.text, + _cardNumberController.text, + 0, + ctxt, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - if (_cardNumberController.text == "") { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } else { - MIHMzansiWalletApis.updateLoyaltyCardAPICall( - widget.signedInUser, - widget.cardList[index].idloyalty_cards, - widget.cardList[index].favourite, - widget.cardList[index].priority_index, - _nicknameController.text, - _cardNumberController.text, - 0, - ctxt, - ); - } - }, - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], @@ -176,27 +185,30 @@ class _BuildLoyaltyCardListState extends State { const SizedBox( height: 15, ), - SizedBox( + MihButton( + onPressed: () { + MIHMzansiWalletApis.updateLoyaltyCardAPICall( + widget.signedInUser, + widget.cardList[index].idloyalty_cards, + "Yes", + _noFavourites, + widget.cardList[index].nickname, + widget.cardList[index].card_number, + 1, + ctxt, + ); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - MIHMzansiWalletApis.updateLoyaltyCardAPICall( - widget.signedInUser, - widget.cardList[index].idloyalty_cards, - "Yes", - _noFavourites, - widget.cardList[index].nickname, - widget.cardList[index].card_number, - 1, - ctxt, - ); - }, - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Add", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], @@ -232,27 +244,30 @@ class _BuildLoyaltyCardListState extends State { const SizedBox( height: 15, ), - SizedBox( + MihButton( + onPressed: () { + MIHMzansiWalletApis.updateLoyaltyCardAPICall( + widget.signedInUser, + widget.cardList[index].idloyalty_cards, + "", + 0, + widget.cardList[index].nickname, + widget.cardList[index].card_number, + 0, + ctxt, + ); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - MIHMzansiWalletApis.updateLoyaltyCardAPICall( - widget.signedInUser, - widget.cardList[index].idloyalty_cards, - "", - 0, - widget.cardList[index].nickname, - widget.cardList[index].card_number, - 0, - ctxt, - ); - }, - buttonText: "Remove", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Remove", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/mzansi_wallet/components/mih_barcode_scanner.dart b/Frontend/lib/mih_packages/mzansi_wallet/components/mih_barcode_scanner.dart index 9abbccd0..9fd7fd2d 100644 --- a/Frontend/lib/mih_packages/mzansi_wallet/components/mih_barcode_scanner.dart +++ b/Frontend/lib/mih_packages/mzansi_wallet/components/mih_barcode_scanner.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:flutter/material.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; class MihBarcodeScanner extends StatefulWidget { final TextEditingController cardNumberController; @@ -120,17 +120,25 @@ class _MihBarcodeScannerState extends State children: [ Padding( padding: const EdgeInsets.all(10.0), - child: MIHButton( - onTap: () { + child: MihButton( + onPressed: () { _scannerController.stop(); Navigator.of(context).pop(); }, - buttonText: "Cancel", buttonColor: MzanziInnovationHub.of(context)! .theme .secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + width: 100, + child: Text( + "Cancel", + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ), // GestureDetector( diff --git a/Frontend/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart b/Frontend/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart index 22fe42f6..d48cf20d 100644 --- a/Frontend/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart +++ b/Frontend/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart @@ -1,12 +1,12 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_wallet_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; @@ -184,51 +184,58 @@ class _MihCardsState extends State { ), ), const SizedBox(width: 10), - MIHButton( - onTap: () async { - openscanner(); - }, - buttonText: "Scan", + MihButton( + onPressed: () {}, buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + width: 100, + child: Text( + "Scan", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), ), ], ), const SizedBox(height: 15), - SizedBox( + MihButton( + onPressed: () { + if (shopController.text == "" || + cardNumberController.text == "") { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } else { + MIHMzansiWalletApis.addLoyaltyCardAPICall( + widget.signedInUser, + widget.signedInUser.app_id, + shopController.text, + cardNumberController.text, + "", + 0, + _nicknameController.text, + 0, + context, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - if (shopController.text == "" || - cardNumberController.text == "") { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } else { - MIHMzansiWalletApis.addLoyaltyCardAPICall( - widget.signedInUser, - widget.signedInUser.app_id, - shopController.text, - cardNumberController.text, - "", - 0, - _nicknameController.text, - 0, - context, - ); - } - }, - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Add", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_mih_patient_search_list.dart b/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_mih_patient_search_list.dart index 4f43cc81..868ffefe 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_mih_patient_search_list.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_mih_patient_search_list.dart @@ -2,10 +2,10 @@ import 'dart:convert'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_api_calls.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; @@ -208,34 +208,34 @@ class _BuildPatientsListState extends State { required: true, ), const SizedBox(height: 30.0), - SizedBox( + MihButton( + onPressed: () { + bool filled = isAppointmentFieldsFilled(); + if (filled) { + //print("here2"); + submitApointment(index); + //print("here3"); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Book", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - //print("here1"); - bool filled = isAppointmentFieldsFilled(); - //print("fields filled: $filled"); - if (filled) { - //print("here2"); - submitApointment(index); - //print("here3"); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Book", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ), ), @@ -427,111 +427,97 @@ class _BuildPatientsListState extends State { ), // const SizedBox(height: 15.0), Wrap(runSpacing: 10, spacing: 10, children: [ - // Visibility( - // visible: hasAccess, - // child: SizedBox( - // width: 300, - // height: 50, - // child: MIHButton( - // buttonText: "Book Appointment", - // buttonColor: - // MzanziInnovationHub.of(context)!.theme.secondaryColor(), - // textColor: - // MzanziInnovationHub.of(context)!.theme.primaryColor(), - // onTap: () { - // if (hasAccess) { - // appointmentPopUp(index); - // } else { - // noAccessWarning(); - // } - // }, - // ), - // ), - // ), Visibility( visible: hasAccess, - child: SizedBox( + child: MihButton( + onPressed: () { + if (hasAccess) { + Navigator.of(context) + .pushNamed('/patient-manager/patient', + arguments: PatientViewArguments( + widget.signedInUser, + widget.patients[index], + widget.businessUser, + widget.business, + "business", + )); + } else { + noAccessWarning(); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "View Patient Profile", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - if (hasAccess) { - Navigator.of(context) - .pushNamed('/patient-manager/patient', - arguments: PatientViewArguments( - widget.signedInUser, - widget.patients[index], - widget.businessUser, - widget.business, - "business", - )); - } else { - noAccessWarning(); - } - }, + child: Text( + "View Profile", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ), Visibility( visible: !hasAccess && accessStatus == "No Access", - child: SizedBox( + child: MihButton( + onPressed: () { + MIHApiCalls.addPatientAccessAPICall( + widget.business!.business_id, + widget.patients[index].app_id, + "patient", + widget.business!.Name, + widget.personalSelected, + BusinessArguments( + widget.signedInUser, + widget.businessUser, + widget.business, + ), + context, + ); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Request Access", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - //print("Send access Request..."); - MIHApiCalls.addPatientAccessAPICall( - widget.business!.business_id, - widget.patients[index].app_id, - "patient", - widget.business!.Name, - widget.personalSelected, - BusinessArguments( - widget.signedInUser, - widget.businessUser, - widget.business, - ), - context, - ); - }, + child: Text( + "Request Access", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ), Visibility( visible: !hasAccess && accessStatus == "declined", - child: SizedBox( + child: MihButton( + onPressed: () { + MIHApiCalls.reapplyPatientAccessAPICall( + widget.business!.business_id, + widget.patients[index].app_id, + widget.personalSelected, + BusinessArguments( + widget.signedInUser, + widget.businessUser, + widget.business, + ), + context, + ); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Re-apply", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - // print("Send rewaply access Request..."); - MIHApiCalls.reapplyPatientAccessAPICall( - widget.business!.business_id, - widget.patients[index].app_id, - widget.personalSelected, - BusinessArguments( - widget.signedInUser, - widget.businessUser, - widget.business, - ), - context, - ); - }, + child: Text( + "Re-apply", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ), diff --git a/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_my_patient_list_list.dart b/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_my_patient_list_list.dart index c90171d1..c79378fd 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_my_patient_list_list.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_manager/list_builders/build_my_patient_list_list.dart @@ -1,10 +1,10 @@ import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_api_calls.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_calendar_apis.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart'; @@ -141,34 +141,32 @@ class _BuildPatientsListState extends State { required: true, ), const SizedBox(height: 30.0), - SizedBox( + MihButton( + onPressed: () { + bool filled = isAppointmentFieldsFilled(); + if (filled) { + submitApointment(index); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Book", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - //print("here1"); - bool filled = isAppointmentFieldsFilled(); - //print("fields filled: $filled"); - if (filled) { - //print("here2"); - submitApointment(index); - //print("here3"); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Book Appointment", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ), ), @@ -246,40 +244,45 @@ class _BuildPatientsListState extends State { ), const SizedBox(height: 30.0), Wrap(runSpacing: 10, spacing: 10, children: [ - SizedBox( + MihButton( + onPressed: () { + appointmentPopUp(index); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Book Appointment", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - appointmentPopUp(index); - }, + child: Text( + "Book Appointment", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), - SizedBox( + MihButton( + onPressed: () { + Navigator.of(context).pushNamed('/patient-manager/patient', + arguments: PatientViewArguments( + widget.signedInUser, + patientProfile, + widget.businessUser, + widget.business, + "business", + )); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "View Patient Profile", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - // Navigator.of(context).pop(); - Navigator.of(context).pushNamed('/patient-manager/patient', - arguments: PatientViewArguments( - widget.signedInUser, - patientProfile, - widget.businessUser, - widget.business, - "business", - )); - }, + child: Text( + "View Medical Records", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ]) diff --git a/Frontend/lib/mih_packages/patient_profile/pat_manager/package_tools/waiting_room.dart b/Frontend/lib/mih_packages/patient_profile/pat_manager/package_tools/waiting_room.dart index 77736618..7b7d5dc0 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_manager/package_tools/waiting_room.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_manager/package_tools/waiting_room.dart @@ -2,12 +2,12 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_calendar_apis.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_calendar.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_multiline_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; @@ -240,51 +240,60 @@ class _WaitingRoomState extends State { textAlign: TextAlign.left, ), const SizedBox(height: 15), - SizedBox( - width: 500, - height: 50, - child: MIHButton( - onTap: () { - widget.onIndexChange(1); - Navigator.of(context).pop(); - }, - buttonText: "Existing Patient", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + widget.onIndexChange(1); + Navigator.of(context).pop(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Existing Patient", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), const SizedBox(height: 10), - SizedBox( - width: 500, - height: 50, - child: MIHButton( - onTap: () { - widget.onIndexChange(2); - Navigator.of(context).pop(); - }, - buttonText: "Existing MIH User", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + widget.onIndexChange(2); + Navigator.of(context).pop(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Existing MIH User", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), const SizedBox(height: 10), - SizedBox( - width: 500, - height: 50, - child: MIHButton( - onTap: () { - Navigator.pop(context); - addAppointmentWindow(); - }, - buttonText: "Skeleton Appointment", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + Navigator.pop(context); + addAppointmentWindow(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Skeleton Appointment", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], @@ -351,18 +360,21 @@ class _WaitingRoomState extends State { ), ), const SizedBox(height: 20), - SizedBox( - width: 500, - height: 50, - child: MIHButton( - onTap: () { - addAppointmentCall(); - }, - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + addAppointmentCall(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.successColor(), + width: 300, + child: Text( + "Add", + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/patient_profile/pat_profile/components/Claim_Statement_Window.dart b/Frontend/lib/mih_packages/patient_profile/pat_profile/components/Claim_Statement_Window.dart index b89c76b6..0344b7cb 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_profile/components/Claim_Statement_Window.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_profile/components/Claim_Statement_Window.dart @@ -1,11 +1,11 @@ import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_claim_statement_generation_api.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_icd10_code_api.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_objects/app_user.dart'; @@ -224,66 +224,67 @@ class _ClaimStatementWindowState extends State { required: false, ), const SizedBox(height: 15), - SizedBox( - width: 500, - height: 50, - child: MIHButton( - onTap: () { - //generate document and uploud it - if (isInputValid()) { - MIHClaimStatementGenerationApi().generateClaimStatement( - ClaimStatementGenerationArguments( - _docTypeController.text, - widget.selectedPatient.app_id, - _fullNameController.text, - _idController.text, - _medAidController.text, - _medAidNoController.text, - _medAidCodeController.text, - _medAidNameController.text, - _medAidSchemeController.text, - widget.business!.Name, - "*To-Be Added*", - widget.business!.contact_no, - widget.business!.bus_email, - _providerNameController.text, - _practiceNoController.text, - _vatNoController.text, - _serviceDateController.text, - _serviceDescController.text, - _serviceDescOptionsController.text, - _prcedureNameController.text, - _proceedureAdditionalInfoController.text, - _icd10CodeController.text, - _amountController.text, - _preauthNoController.text, - widget.business!.logo_path, - widget.businessUser!.sig_path, - ), - PatientViewArguments( - widget.signedInUser, - widget.selectedPatient, - widget.businessUser, - widget.business, - "business", - ), - widget.env, - context); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, - buttonText: "Generate", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + if (isInputValid()) { + MIHClaimStatementGenerationApi().generateClaimStatement( + ClaimStatementGenerationArguments( + _docTypeController.text, + widget.selectedPatient.app_id, + _fullNameController.text, + _idController.text, + _medAidController.text, + _medAidNoController.text, + _medAidCodeController.text, + _medAidNameController.text, + _medAidSchemeController.text, + widget.business!.Name, + "*To-Be Added*", + widget.business!.contact_no, + widget.business!.bus_email, + _providerNameController.text, + _practiceNoController.text, + _vatNoController.text, + _serviceDateController.text, + _serviceDescController.text, + _serviceDescOptionsController.text, + _prcedureNameController.text, + _proceedureAdditionalInfoController.text, + _icd10CodeController.text, + _amountController.text, + _preauthNoController.text, + widget.business!.logo_path, + widget.businessUser!.sig_path, + ), + PatientViewArguments( + widget.signedInUser, + widget.selectedPatient, + widget.businessUser, + widget.business, + "business", + ), + widget.env, + context); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Generate", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ); } diff --git a/Frontend/lib/mih_packages/patient_profile/pat_profile/components/prescip_input.dart b/Frontend/lib/mih_packages/patient_profile/pat_profile/components/prescip_input.dart index f4e65682..c5275651 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_profile/components/prescip_input.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_profile/components/prescip_input.dart @@ -1,8 +1,8 @@ import 'dart:convert'; import 'package:mzansi_innovation_hub/main.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/components/medicine_search.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; @@ -419,43 +419,38 @@ class _PrescripInputState extends State { enableSearch: false, ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () { + if (isFieldsFilled()) { + setState(() { + updatePerscriptionList(); + widget.medicineController.clear(); + widget.quantityController.clear(); + widget.dosageController.clear(); + widget.timesDailyController.clear(); + widget.noDaysController.clear(); + widget.noRepeatsController.clear(); + }); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - if (isFieldsFilled()) { - // int quantity; - // int.parse(widget.dosageController.text) * - // int.parse(widget.timesDailyController.text) * - // int.parse(widget.noDaysController.text); - setState(() { - //widget.quantityController.text = "$quantity"; - updatePerscriptionList(); - widget.medicineController.clear(); - widget.quantityController.clear(); - widget.dosageController.clear(); - widget.timesDailyController.clear(); - widget.noDaysController.clear(); - widget.noRepeatsController.clear(); - }); - - //addPatientAPICall(); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Add", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ); } @@ -516,29 +511,32 @@ class _PrescripInputState extends State { ), ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () async { + if (perscriptionObjOutput.isNotEmpty) { + //print(jsonEncode(perscriptionObjOutput)); + await generatePerscription(); + Navigator.pop(context); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: MzanziInnovationHub.of(context)!.theme.successColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () async { - if (perscriptionObjOutput.isNotEmpty) { - //print(jsonEncode(perscriptionObjOutput)); - await generatePerscription(); - Navigator.pop(context); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, - buttonText: "Generate", - buttonColor: MzanziInnovationHub.of(context)!.theme.successColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Generate", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ); } diff --git a/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_consultation.dart b/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_consultation.dart index 9ace1cfb..8f6f9ef2 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_consultation.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_consultation.dart @@ -1,10 +1,10 @@ import 'dart:convert'; import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_multiline_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; @@ -160,30 +160,32 @@ class _PatientConsultationState extends State { ), ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () { + if (isFieldsFilled()) { + addPatientNoteAPICall(); + Navigator.pop(context); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - onTap: () { - if (isFieldsFilled()) { - addPatientNoteAPICall(); - Navigator.pop(context); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, - buttonText: "Add Note", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), + child: Text( + "Add Note", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ), ), diff --git a/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_documents.dart b/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_documents.dart index af1661ab..b9a99765 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_documents.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_profile/package_tools/patient_documents.dart @@ -4,9 +4,9 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart'; import 'package:mzansi_innovation_hub/mih_components/med_cert_input.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_file_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart'; @@ -252,31 +252,33 @@ class _PatientDocumentsState extends State { }, ), const SizedBox(height: 15), - SizedBox( + MihButton( + onPressed: () { + if (isFileFieldsFilled()) { + submitDocUploadForm(); + // uploadSelectedFile(selected); + Navigator.pop(context); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Add File", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () { - if (isFileFieldsFilled()) { - submitDocUploadForm(); - // uploadSelectedFile(selected); - Navigator.pop(context); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Add File", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ), ), @@ -301,30 +303,32 @@ class _PatientDocumentsState extends State { retDateTextController: retDateTextController, ), const SizedBox(height: 15.0), - SizedBox( + MihButton( + onPressed: () async { + if (isMedCertFieldsFilled()) { + await generateMedCert(); + //Navigator.pop(context); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), width: 300, - height: 50, - child: MIHButton( - buttonText: "Generate", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onTap: () async { - if (isMedCertFieldsFilled()) { - await generateMedCert(); - //Navigator.pop(context); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage(errorType: "Input Error"); - }, - ); - } - }, + child: Text( + "Generate", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), - ) + ), ], ), ), diff --git a/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_add.dart b/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_add.dart index 634c3f8e..4b9fdc32 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_add.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_add.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart'; @@ -9,6 +8,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart'; @@ -289,17 +289,20 @@ class _AddPatientState extends State { }, ), const SizedBox(height: 30.0), - SizedBox( - width: 450.0, - height: 50.0, - child: MIHButton( - onTap: () { - submitForm(); - }, - buttonText: "Add", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + submitForm(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Add", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_edit.dart b/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_edit.dart index 44edf597..81ad520a 100644 --- a/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_edit.dart +++ b/Frontend/lib/mih_packages/patient_profile/pat_profile/patient_edit.dart @@ -1,13 +1,13 @@ import 'dart:convert'; import 'package:mzansi_innovation_hub/main.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart'; +import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart'; @@ -272,19 +272,23 @@ class _EditPatientState extends State { ), ), ), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - onTap: deletePatientApiCall, - buttonText: "Delete", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! + MihButton( + onPressed: deletePatientApiCall, + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 300, + child: Text( + "Delete", + style: TextStyle( + color: MzanziInnovationHub.of(context)! .theme .primaryColor(), - )) + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), ], ), ), @@ -520,17 +524,20 @@ class _EditPatientState extends State { }, ), const SizedBox(height: 30.0), - SizedBox( - width: 500.0, - height: 50.0, - child: MIHButton( - onTap: () { - submitForm(); - }, - buttonText: "Update", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + MihButton( + onPressed: () { + submitForm(); + }, + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 300, + child: Text( + "Update", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/Frontend/pubspec.lock b/Frontend/pubspec.lock index 878a811d..ea7062b7 100644 --- a/Frontend/pubspec.lock +++ b/Frontend/pubspec.lock @@ -17,6 +17,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.13.0" + animated_button: + dependency: "direct main" + description: + name: animated_button + sha256: "238e093023955b3a21b14d230baeecb94fc796379e3dd8ee534c158838f24024" + url: "https://pub.dev" + source: hosted + version: "0.3.1" ansicolor: dependency: transitive description: diff --git a/Frontend/pubspec.yaml b/Frontend/pubspec.yaml index 40eb965c..a2a719dc 100644 --- a/Frontend/pubspec.yaml +++ b/Frontend/pubspec.yaml @@ -76,6 +76,7 @@ dependencies: flutter_speed_dial: ^7.0.0 share_plus: ^10.1.4 app_settings: ^6.1.1 + animated_button: ^0.3.1 dev_dependencies: flutter_test: