create new MIH Button

This commit is contained in:
2025-05-29 10:55:51 +02:00
parent 3d75efb0bb
commit c0a35411b5
46 changed files with 1704 additions and 2633 deletions

View File

@@ -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<MIHButton> createState() => _MIHButtonState();
}
class _MIHButtonState extends State<MIHButton> {
@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,
),
),
);
}
}

View File

@@ -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<PackageToolOne> {
],
),
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,

View File

@@ -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<MihButton> createState() => _MihButtonState();
}
class _MihButtonState extends State<MihButton> {
@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),
),
);
}
}

View File

@@ -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<MIHDeleteMessage> {
),
),
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<MIHDeleteMessage> {
),
),
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<MIHDeleteMessage> {
),
),
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<MIHDeleteMessage> {
),
),
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<MIHDeleteMessage> {
),
),
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,
),
),
),
],
),
),

View File

@@ -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<MIHSuccessMessage> {
),
),
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,
),
),
),
],

View File

@@ -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<MihAttributes> {
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,
),
),
),
),
),

View File

@@ -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<MihInfo> {
}
}
// 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<MihInfo> {
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,
),
),
),
]),

View File

@@ -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<BuildAccessRequestList> {
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<BuildAccessRequestList> {
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

View File

@@ -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<BuildBusinessAccessList> {
late double width;
late double height;
// Future<void> updateAccessAPICall(int index, String accessType) async {
// var response = await http.put(
// Uri.parse("$baseAPI/access-requests/update/"),
// headers: <String, String>{
// "Content-Type": "application/json; charset=UTF-8"
// },
// body: jsonEncode(<String, dynamic>{
// "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<BuildBusinessAccessList> {
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,
),
),
),
],

View File

@@ -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<BiometricCheck> {
),
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<BiometricCheck> {
),
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<BiometricCheck> {
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,
),
),
),

View File

@@ -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<ForgotPassword> {
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<ForgotPassword> {
),
//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,
),
),
),
],

View File

@@ -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<Register> {
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<Register> {
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<Register> {
),
),
//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,

View File

@@ -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<ResetPassword> {
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<ResetPassword> {
),
//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,
),
),
),
],

View File

@@ -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<SignIn> {
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<SignIn> {
//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

View File

@@ -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<SimpleCalc> {
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<SimpleCalc> {
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<SimpleCalc> {
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<SimpleCalc> {
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<SimpleCalc> {
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<SimpleCalc> {
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<SimpleCalc> {
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<SimpleCalc> {
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<SimpleCalc> {
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,
),
),
),
);
}

View File

@@ -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<TipCalc> {
);
},
),
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,
),
),
),
],
),
],
),

View File

@@ -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<BuildAccessRequestList> {
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,
),
),
),
],

View File

@@ -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<BuildAppointmentList> {
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,
),
),
),
],

View File

@@ -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<Appointments> {
),
),
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,
),
),
),
],

View File

@@ -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<MIHProfileGetter> {
),
),
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(

View File

@@ -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<BuildEmployeeList> {
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,
),
),
)
),
],
),
),

View File

@@ -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<BuildUserList> {
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),

View File

@@ -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<MihBusinessDetails> {
),
),
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,
),
),
),
],

View File

@@ -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<MihBusinessProfile> createState() => _MihBusinessProfileState();
}
class _MihBusinessProfileState extends State<MihBusinessProfile> {
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<Object>? logoPreview = null;
final ValueNotifier<String> busType = ValueNotifier("");
late String business_id;
late String oldLogoPath;
late String oldSigPath;
String logoUri = "";
late String env;
Future<void> 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: <String, String>{
"Content-Type": "application/json; charset=UTF-8"
},
body: jsonEncode(<String, dynamic>{
"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<void> updateBusinessUserAPICall(String business_id) async {
var response = await http.put(
Uri.parse("$baseAPI/business-user/update/"),
headers: <String, String>{
"Content-Type": "application/json; charset=UTF-8"
},
body: jsonEncode(<String, dynamic>{
"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<void> 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<void> 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);
},
),
),
],
),
],
),
),
);
}
}

View File

@@ -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<MihMyBusinessUser> {
),
),
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,
),
),
),
],

View File

@@ -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<ProfileBusinessAdd> {
),
),
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<ProfileBusinessAdd> {
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<ProfileBusinessAdd> {
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,
),
),
),
],

View File

@@ -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<BuildEmployeeList> {
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) {

View File

@@ -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<BuildUserList> {
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),

View File

@@ -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<BusinessAbout> {
// ),
//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,
),
),
),
],

View File

@@ -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<BusinessDetails> {
),
),
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<BusinessDetails> {
// ),
//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,
),
),
),
],

View File

@@ -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<MihPersonalProfile> {
],
),
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,
),
),
),
],

View File

@@ -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<MihPersonalSettings> {
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<MihPersonalSettings> {
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,
),
),
),
],

View File

@@ -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<BuildLoyaltyCardList> {
),
),
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<BuildLoyaltyCardList> {
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<BuildLoyaltyCardList> {
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,
),
),
),
],

View File

@@ -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<MihBarcodeScanner>
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(

View File

@@ -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<MihCards> {
),
),
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,
),
),
),
],

View File

@@ -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<BuildMihPatientSearchList> {
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<BuildMihPatientSearchList> {
),
// 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,
),
),
),
),

View File

@@ -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<BuildMyPatientListList> {
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<BuildMyPatientListList> {
),
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,
),
),
),
])

View File

@@ -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<WaitingRoom> {
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<WaitingRoom> {
),
),
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,
),
),
),
],

View File

@@ -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<ClaimStatementWindow> {
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,
),
),
)
),
],
);
}

View File

@@ -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<PrescripInput> {
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<PrescripInput> {
),
),
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,
),
),
)
),
],
);
}

View File

@@ -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<PatientConsultation> {
),
),
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,
),
),
)
),
],
),
),

View File

@@ -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<PatientDocuments> {
},
),
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<PatientDocuments> {
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,
),
),
)
),
],
),
),

View File

@@ -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<AddPatient> {
},
),
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,
),
),
),
],

View File

@@ -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<EditPatient> {
),
),
),
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<EditPatient> {
},
),
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,
),
),
),
],