use Mih Package Window instead of MIH Window

This commit is contained in:
2025-05-27 13:57:10 +02:00
parent 2f071bfa22
commit 10b77eb51c
27 changed files with 2401 additions and 2382 deletions

View File

@@ -1,7 +1,7 @@
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_yt_video_player.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_yt_video_player.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../main.dart';
import 'mih_window.dart';
class MIHTile extends StatefulWidget { class MIHTile extends StatefulWidget {
final String tileName; final String tileName;
@@ -47,16 +47,18 @@ class _MIHTileState extends State<MIHTile> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: widget.tileName, windowTitle: widget.tileName,
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHYTVideoPlayer(videoYTLink: widget.videoID!), children: [
], MIHYTVideoPlayer(videoYTLink: widget.videoID!),
],
),
); );
}, },
); );

View File

@@ -1,214 +0,0 @@
import 'package:flutter/material.dart';
import '../../main.dart';
class MIHWindow extends StatefulWidget {
final String windowTitle;
final List<Widget> windowBody;
final List<Widget> windowTools;
final void Function() onWindowTapClose;
final bool fullscreen;
const MIHWindow({
super.key,
required this.fullscreen,
required this.windowTitle,
required this.windowTools,
required this.onWindowTapClose,
required this.windowBody,
});
@override
State<MIHWindow> createState() => _MIHWindowState();
}
class _MIHWindowState extends State<MIHWindow> {
late double windowTitleSize;
late double horizontralWindowPadding;
late double vertticalWindowPadding;
late double windowWidth;
late double windowHeight;
late double width;
late double height;
void checkScreenSize() {
// print("screen width: $width");
// print("screen height: $height");
if (MzanziInnovationHub.of(context)!.theme.screenType == "desktop") {
setState(() {
windowTitleSize = 25;
horizontralWindowPadding = width / 7;
vertticalWindowPadding = 25;
windowWidth = width;
windowHeight = height;
});
} else {
setState(() {
windowTitleSize = 20;
horizontralWindowPadding = 10;
vertticalWindowPadding = 10;
windowWidth = width;
windowHeight = height;
});
}
}
Widget getWidnowClose() {
return Container(
alignment: Alignment.centerRight,
child: IconButton(
onPressed: widget.onWindowTapClose,
icon: Icon(
Icons.close,
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
size: 35,
),
),
);
}
Widget getWidnowTools() {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: widget.windowTools,
);
}
Widget getWidnowTitle() {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Text(
widget.windowTitle,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fontSize: windowTitleSize,
fontWeight: FontWeight.bold,
),
),
),
],
);
}
Widget getWidnowHeader() {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
getWidnowTools(),
Expanded(
flex: 2,
child: getWidnowTitle(),
),
getWidnowClose(),
],
);
}
Widget getWidnowBody() {
if (widget.fullscreen) {
return Expanded(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: widget.windowBody,
),
),
);
} else {
return Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: widget.windowBody,
),
);
}
}
Widget createWindow(Widget header, Widget body) {
Widget visibleItems;
if (widget.fullscreen) {
visibleItems = Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
header,
//const Divider(),
body,
],
);
} else {
visibleItems = SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
header,
//const Divider(),
body,
],
),
);
}
return Dialog(
insetPadding: EdgeInsets.symmetric(
horizontal: horizontralWindowPadding,
vertical: vertticalWindowPadding,
),
insetAnimationCurve: Easing.emphasizedDecelerate,
insetAnimationDuration: Durations.short1,
child: Container(
//padding: const EdgeInsets.all(10),
width: windowWidth,
//height: windowHeight,
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: visibleItems,
),
);
}
@override
void dispose() {
super.dispose();
}
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
setState(() {
width = size.width;
height = size.height;
});
checkScreenSize();
return createWindow(
getWidnowHeader(),
getWidnowBody(),
);
}
}

View File

@@ -1,18 +1,17 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; 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_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';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
import 'package:mzansi_innovation_hub/mih_env/env.dart';
import 'package:mzansi_innovation_hub/mih_objects/access_request.dart';
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
import 'package:supertokens_flutter/http.dart' as http; 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_layout/mih_window.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';
import '../../../mih_env/env.dart';
import '../../../mih_objects/access_request.dart';
import '../../../mih_objects/app_user.dart';
class BuildAccessRequestList extends StatefulWidget { class BuildAccessRequestList extends StatefulWidget {
final List<AccessRequest> accessRequests; final List<AccessRequest> accessRequests;
final AppUser signedInUser; final AppUser signedInUser;
@@ -220,65 +219,67 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Update Appointment Access", windowTitle: "Update Appointment Access",
windowBody: [ windowBody: Column(
const SizedBox( children: [
height: 10, const SizedBox(
), height: 10,
Padding( ),
padding: const EdgeInsets.symmetric(horizontal: 10.0), Padding(
child: Text( padding: const EdgeInsets.symmetric(horizontal: 10.0),
subtitle, child: Text(
textAlign: TextAlign.left, subtitle,
style: TextStyle( textAlign: TextAlign.left,
color: style: TextStyle(
MzanziInnovationHub.of(context)!.theme.secondaryColor(), color:
fontSize: popUpBodySize, MzanziInnovationHub.of(context)!.theme.secondaryColor(),
//fontWeight: FontWeight.bold, fontSize: popUpBodySize,
//fontWeight: FontWeight.bold,
),
), ),
), ),
), Wrap(
Wrap( runSpacing: 10,
runSpacing: 10, spacing: 10,
spacing: 10, children: [
children: [ SizedBox(
SizedBox( width: popUpButtonWidth,
width: popUpButtonWidth, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { updateAccessAPICall(index, "declined");
updateAccessAPICall(index, "declined"); },
}, buttonText: "Decline",
buttonText: "Decline", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.errorColor(),
MzanziInnovationHub.of(context)!.theme.errorColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), SizedBox(
SizedBox( width: popUpButtonWidth,
width: popUpButtonWidth, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { updateAccessAPICall(index, "approved");
updateAccessAPICall(index, "approved"); },
}, buttonText: "Approve",
buttonText: "Approve", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.successColor(),
MzanziInnovationHub.of(context)!.theme.successColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), ],
], ),
), const SizedBox(
const SizedBox( height: 10,
height: 10, ),
), ],
], ),
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}), }),

View File

@@ -1,15 +1,14 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/main.dart';
import '../../../main.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_api_calls.dart';
import '../../../mih_apis/mih_api_calls.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import '../../../mih_components/mih_layout/mih_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
import '../../../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 '../../../mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
import '../../../mih_components/mih_pop_up_messages/mih_warning_message.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart';
import '../../../mih_env/env.dart'; import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
import '../../../mih_objects/app_user.dart'; import 'package:mzansi_innovation_hub/mih_objects/patient_access.dart';
import '../../../mih_objects/patient_access.dart';
class BuildBusinessAccessList extends StatefulWidget { class BuildBusinessAccessList extends StatefulWidget {
final List<PatientAccess> patientAccessList; final List<PatientAccess> patientAccessList;
@@ -216,217 +215,228 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Profile Access", windowTitle: "Profile Access",
windowBody: [ windowBody: Column(
const SizedBox( children: [
height: 10, const SizedBox(
), height: 10,
SizedBox( ),
width: 1000, SizedBox(
child: Text( width: 1000,
subtitle, child: Text(
textAlign: TextAlign.left, subtitle,
style: TextStyle( textAlign: TextAlign.left,
color: style: TextStyle(
MzanziInnovationHub.of(context)!.theme.secondaryColor(), color:
fontSize: popUpBodySize, MzanziInnovationHub.of(context)!.theme.secondaryColor(),
//fontWeight: FontWeight.bold, fontSize: popUpBodySize,
//fontWeight: FontWeight.bold,
),
), ),
), ),
), const SizedBox(height: 20.0),
const SizedBox(height: 20.0), Visibility(
Visibility( visible: widget.patientAccessList[index].status == 'pending',
visible: widget.patientAccessList[index].status == 'pending', child: Column(
child: Column( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: [
children: [ Text(
Text( "Important Notice: Approving Profile Access",
"Important Notice: Approving Profile Access", style: TextStyle(
style: TextStyle( fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, color:
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
MzanziInnovationHub.of(context)!.theme.errorColor(), ),
), ),
), Text(
Text( "You are about to accept access to your patient's profile. Please be aware of the following important points:",
"You are about to accept access to your patient's profile. Please be aware of the following important points:",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
SizedBox(
width: 700,
child: Text(
"1. Permanent Access: Once you accepts this access request, it will become permanent.",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: color:
MzanziInnovationHub.of(context)!.theme.errorColor(), MzanziInnovationHub.of(context)!.theme.errorColor(),
), ),
), ),
), SizedBox(
SizedBox( width: 700,
width: 700, child: Text(
child: Text( "1. Permanent Access: Once you accepts this access request, it will become permanent.",
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.", style: TextStyle(
fontWeight: FontWeight.normal,
color: MzanziInnovationHub.of(context)!
.theme
.errorColor(),
),
),
),
SizedBox(
width: 700,
child: Text(
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzanziInnovationHub.of(context)!
.theme
.errorColor(),
),
),
),
SizedBox(
width: 700,
child: Text(
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzanziInnovationHub.of(context)!
.theme
.errorColor(),
),
),
),
Text(
"By pressing the \"Approve\" button you accept the above terms.",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.normal, fontWeight: FontWeight.bold,
color: color:
MzanziInnovationHub.of(context)!.theme.errorColor(), MzanziInnovationHub.of(context)!.theme.errorColor(),
), ),
), ),
), ],
SizedBox( ),
width: 700,
child: Text(
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
),
Text(
"By pressing the \"Approve\" button you accept the above terms.",
style: TextStyle(
fontWeight: FontWeight.bold,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
],
), ),
), Visibility(
Visibility( visible: widget.patientAccessList[index].status == 'approved',
visible: widget.patientAccessList[index].status == 'approved', child: Column(
child: Column( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: [
children: [ Text(
Text( "Important Notice: Approved Profile Access",
"Important Notice: Approved Profile Access", style: TextStyle(
style: TextStyle( fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, color:
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
MzanziInnovationHub.of(context)!.theme.errorColor(), ),
), ),
), Text(
Text( "You have accepted access to your patient's profile. Please be aware of the following important points:",
"You have accepted access to your patient's profile. Please be aware of the following important points:",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
SizedBox(
width: 700,
child: Text(
"1. Permanent Access: This access is permanent.",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: color:
MzanziInnovationHub.of(context)!.theme.errorColor(), MzanziInnovationHub.of(context)!.theme.errorColor(),
), ),
), ),
), SizedBox(
SizedBox( width: 700,
width: 700, child: Text(
child: Text( "1. Permanent Access: This access is permanent.",
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.", style: TextStyle(
style: TextStyle( fontWeight: FontWeight.normal,
fontWeight: FontWeight.normal, color: MzanziInnovationHub.of(context)!
color: .theme
MzanziInnovationHub.of(context)!.theme.errorColor(), .errorColor(),
),
), ),
), ),
), SizedBox(
SizedBox( width: 700,
width: 700, child: Text(
child: Text( "2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
"3. Irreversible Access: You cannot revoke this access to your patient's profile.", style: TextStyle(
style: TextStyle( fontWeight: FontWeight.normal,
fontWeight: FontWeight.normal, color: MzanziInnovationHub.of(context)!
color: .theme
MzanziInnovationHub.of(context)!.theme.errorColor(), .errorColor(),
),
), ),
), ),
), SizedBox(
], width: 700,
child: Text(
"3. Irreversible Access: You cannot revoke this access to your patient's profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzanziInnovationHub.of(context)!
.theme
.errorColor(),
),
),
),
],
),
), ),
), const SizedBox(height: 20.0),
const SizedBox(height: 20.0), const SizedBox(
const SizedBox( height: 20,
height: 20,
),
Visibility(
visible: widget.patientAccessList[index].status == 'pending',
child: Wrap(
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(),
),
),
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(),
),
),
],
), ),
), Visibility(
const SizedBox( visible: widget.patientAccessList[index].status == 'pending',
height: 10, child: Wrap(
), runSpacing: 10,
], spacing: 10,
windowTools: const [], 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(),
),
),
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(),
),
),
],
),
),
const SizedBox(
height: 10,
),
],
),
windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}), }),

View File

@@ -3,8 +3,8 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_layout/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_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'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -116,107 +116,28 @@ class _TipCalcState extends State<TipCalc> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Calculation Results", windowTitle: "Calculation Results",
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowTools: const [], windowTools: null,
windowBody: [ windowBody: Column(
// FaIcon( children: [
// FontAwesomeIcons.moneyBills,
// color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// size: 30,
// ),
// const Divider(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.coins,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
size: 35,
),
const SizedBox(width: 15),
Text(
"Tip",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
),
Text(
tip,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const Divider(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.moneyBills,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
size: 35,
),
const SizedBox(width: 15),
Text(
"Total",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
),
Text(
total,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
Text(
"~ ${double.parse(total).ceil()}.00",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const Divider(),
if (splitBillController.text == "Yes")
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
FaIcon( FaIcon(
FontAwesomeIcons.peopleGroup, FontAwesomeIcons.coins,
color: color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
size: 35, size: 35,
), ),
const SizedBox(width: 15), const SizedBox(width: 15),
Text( Text(
"Total per Person", "Tip",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
@@ -227,9 +148,8 @@ class _TipCalcState extends State<TipCalc> {
), ),
], ],
), ),
if (splitBillController.text == "Yes")
Text( Text(
amountPerPerson, tip,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 30, fontSize: 30,
@@ -237,9 +157,32 @@ class _TipCalcState extends State<TipCalc> {
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
), ),
), ),
if (splitBillController.text == "Yes") const Divider(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.moneyBills,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
size: 35,
),
const SizedBox(width: 15),
Text(
"Total",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
),
Text( Text(
"~ ${double.parse(amountPerPerson).ceil()}.00", total,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 30, fontSize: 30,
@@ -247,8 +190,66 @@ class _TipCalcState extends State<TipCalc> {
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
), ),
), ),
// if (splitBillController.text == "Yes") const Divider(), Text(
], "~ ${double.parse(total).ceil()}.00",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const Divider(),
if (splitBillController.text == "Yes")
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.peopleGroup,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
size: 35,
),
const SizedBox(width: 15),
Text(
"Total per Person",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
],
),
if (splitBillController.text == "Yes")
Text(
amountPerPerson,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
if (splitBillController.text == "Yes")
Text(
"~ ${double.parse(amountPerPerson).ceil()}.00",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
// if (splitBillController.text == "Yes") const Divider(),
],
),
), ),
); );
} }

View File

@@ -1,12 +1,12 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:supertokens_flutter/http.dart' as http; import 'package:supertokens_flutter/http.dart' as http;
import '../../../main.dart'; import '../../../main.dart';
import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart'; import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart';
import '../../../mih_components/mih_layout/mih_window.dart';
import '../../../mih_components/mih_pop_up_messages/mih_error_message.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_success_message.dart';
import '../../../mih_components/mih_pop_up_messages/mih_warning_message.dart'; import '../../../mih_components/mih_pop_up_messages/mih_warning_message.dart';
@@ -221,65 +221,67 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Update Appointment Access", windowTitle: "Update Appointment Access",
windowBody: [ windowBody: Column(
const SizedBox( children: [
height: 10, const SizedBox(
), height: 10,
Padding( ),
padding: const EdgeInsets.symmetric(horizontal: 10.0), Padding(
child: Text( padding: const EdgeInsets.symmetric(horizontal: 10.0),
subtitle, child: Text(
textAlign: TextAlign.left, subtitle,
style: TextStyle( textAlign: TextAlign.left,
color: style: TextStyle(
MzanziInnovationHub.of(context)!.theme.secondaryColor(), color:
fontSize: popUpBodySize, MzanziInnovationHub.of(context)!.theme.secondaryColor(),
//fontWeight: FontWeight.bold, fontSize: popUpBodySize,
//fontWeight: FontWeight.bold,
),
), ),
), ),
), Wrap(
Wrap( runSpacing: 10,
runSpacing: 10, spacing: 10,
spacing: 10, children: [
children: [ SizedBox(
SizedBox( width: popUpButtonWidth,
width: popUpButtonWidth, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { updateAccessAPICall(index, "declined");
updateAccessAPICall(index, "declined"); },
}, buttonText: "Decline",
buttonText: "Decline", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.errorColor(),
MzanziInnovationHub.of(context)!.theme.errorColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), SizedBox(
SizedBox( width: popUpButtonWidth,
width: popUpButtonWidth, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { updateAccessAPICall(index, "approved");
updateAccessAPICall(index, "approved"); },
}, buttonText: "Approve",
buttonText: "Approve", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.successColor(),
MzanziInnovationHub.of(context)!.theme.successColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), ],
], ),
), const SizedBox(
const SizedBox( height: 10,
height: 10, ),
), ],
], ),
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}), }),

View File

@@ -1,3 +1,4 @@
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.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_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_button.dart';
@@ -5,7 +6,8 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_inputs_and_buttons/mih_time_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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';
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_delete_message.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_error_message.dart';
import 'package:mzansi_innovation_hub/mih_env/env.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart';
@@ -151,20 +153,61 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) { builder: (context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Appointment Details", windowTitle: "Appointment Details",
windowTools: [ windowTools: Visibility(
Visibility( visible: canEditAppointment(index),
visible: canEditAppointment(index), child: Padding(
child: IconButton( padding: const EdgeInsets.only(top: 5.0),
onPressed: () { child: MihFloatingMenu(
deleteAppointmentConfirmationWindow(index); animatedIcon: AnimatedIcons.menu_close,
}, direction: SpeedDialDirection.down,
icon: const Icon(Icons.delete), children: [
SpeedDialChild(
child: Icon(
Icons.edit,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Edit Appointment",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
appointmentUpdateWindow(index);
},
),
SpeedDialChild(
child: Icon(
Icons.delete,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Appointment",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
deleteAppointmentConfirmationWindow(index);
},
),
],
), ),
), ),
], ),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
widget.dateController.clear(); widget.dateController.clear();
@@ -172,79 +215,82 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
widget.titleController.clear(); widget.titleController.clear();
widget.descriptionIDController.clear(); widget.descriptionIDController.clear();
}, },
windowBody: [ windowBody: Column(
SizedBox( children: [
// width: 500, const SizedBox(height: 10),
child: MIHTextField( SizedBox(
controller: widget.titleController,
hintText: "Title",
editable: false,
required: false,
),
),
const SizedBox(height: 10),
SizedBox(
// width: 500, // width: 500,
child: MIHTextField( child: MIHTextField(
controller: widget.dateController, controller: widget.titleController,
hintText: "Date", hintText: "Title",
editable: false, editable: false,
required: false, required: false,
)),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHTextField(
controller: widget.timeController,
hintText: "Time",
editable: false,
required: false,
)),
const SizedBox(height: 10),
SizedBox(
// width: 500,
height: 250,
child: MIHMLTextField(
controller: widget.descriptionIDController,
hintText: "Description",
editable: false,
required: false,
),
),
const SizedBox(height: 20),
Visibility(
visible: canEditAppointment(index),
child: SizedBox(
width: 500,
height: 50,
child: MIHButton(
onTap: () {
appointmentUpdateWindow(index);
},
buttonText: "Edit",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
), ),
), const SizedBox(height: 10),
// SizedBox( SizedBox(
// width: 500, // width: 500,
// height: 50, child: MIHTextField(
// child: MIHButton( controller: widget.dateController,
// onTap: () { hintText: "Date",
// addAppointmentCall(); editable: false,
// checkforchange(); required: false,
// }, )),
// buttonText: "Add", const SizedBox(height: 10),
// buttonColor: SizedBox(
// MzanziInnovationHub.of(context)!.theme.successColor(), // width: 500,
// textColor: child: MIHTextField(
// MzanziInnovationHub.of(context)!.theme.primaryColor(), controller: widget.timeController,
// ), hintText: "Time",
// ), editable: false,
], required: false,
)),
const SizedBox(height: 10),
SizedBox(
// width: 500,
height: 250,
child: MIHMLTextField(
controller: widget.descriptionIDController,
hintText: "Description",
editable: false,
required: false,
),
),
const SizedBox(height: 10),
// Visibility(
// visible: canEditAppointment(index),
// child: SizedBox(
// width: 500,
// height: 50,
// child: MIHButton(
// onTap: () {
// appointmentUpdateWindow(index);
// },
// buttonText: "Edit",
// buttonColor:
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// textColor:
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
// ),
// ),
// ),
// SizedBox(
// width: 500,
// height: 50,
// child: MIHButton(
// onTap: () {
// addAppointmentCall();
// checkforchange();
// },
// buttonText: "Add",
// buttonColor:
// MzanziInnovationHub.of(context)!.theme.successColor(),
// textColor:
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
// ),
// ),
],
),
); );
}, },
); );
@@ -255,20 +301,61 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) { builder: (context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Appointment Details", windowTitle: "Appointment Details",
windowTools: [ windowTools: Visibility(
Visibility( visible: canEditAppointment(index),
visible: canEditAppointment(index), child: Padding(
child: IconButton( padding: const EdgeInsets.only(top: 5.0),
onPressed: () { child: MihFloatingMenu(
deleteAppointmentConfirmationWindow(index); animatedIcon: AnimatedIcons.menu_close,
}, direction: SpeedDialDirection.down,
icon: const Icon(Icons.delete), children: [
SpeedDialChild(
child: Icon(
Icons.edit,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Edit Appointment",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
appointmentUpdateWindow(index);
},
),
SpeedDialChild(
child: Icon(
Icons.delete,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Appointment",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
deleteAppointmentConfirmationWindow(index);
},
),
],
), ),
), ),
], ),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
widget.dateController.clear(); widget.dateController.clear();
@@ -276,89 +363,91 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
widget.titleController.clear(); widget.titleController.clear();
widget.descriptionIDController.clear(); widget.descriptionIDController.clear();
}, },
windowBody: [ windowBody: Column(
SizedBox( children: [
// width: 500, SizedBox(
child: MIHTextField(
controller: widget.titleController,
hintText: "Title",
editable: false,
required: false,
),
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHTextField(
controller: widget.titleController,
hintText: "Patient ID Number",
editable: false,
required: false,
),
),
const SizedBox(height: 10),
SizedBox(
// width: 500, // width: 500,
child: MIHTextField( child: MIHTextField(
controller: widget.dateController, controller: widget.titleController,
hintText: "Date", hintText: "Title",
editable: false, editable: false,
required: false, required: false,
)),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHTextField(
controller: widget.timeController,
hintText: "Time",
editable: false,
required: false,
)),
const SizedBox(height: 10),
SizedBox(
// width: 500,
height: 250,
child: MIHMLTextField(
controller: widget.descriptionIDController,
hintText: "Description",
editable: false,
required: false,
),
),
const SizedBox(height: 20),
Visibility(
visible: canEditAppointment(index),
child: SizedBox(
width: 500,
height: 50,
child: MIHButton(
onTap: () {
appointmentUpdateWindow(index);
},
buttonText: "Edit",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
), ),
), const SizedBox(height: 10),
// SizedBox( SizedBox(
// width: 500, // width: 500,
// height: 50, child: MIHTextField(
// child: MIHButton( controller: widget.titleController,
// onTap: () { hintText: "Patient ID Number",
// addAppointmentCall(); editable: false,
// checkforchange(); required: false,
// }, ),
// buttonText: "Add", ),
// buttonColor: const SizedBox(height: 10),
// MzanziInnovationHub.of(context)!.theme.successColor(), SizedBox(
// textColor: // width: 500,
// MzanziInnovationHub.of(context)!.theme.primaryColor(), child: MIHTextField(
// ), controller: widget.dateController,
// ), hintText: "Date",
], editable: false,
required: false,
)),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHTextField(
controller: widget.timeController,
hintText: "Time",
editable: false,
required: false,
)),
const SizedBox(height: 10),
SizedBox(
// width: 500,
height: 250,
child: MIHMLTextField(
controller: widget.descriptionIDController,
hintText: "Description",
editable: false,
required: false,
),
),
const SizedBox(height: 20),
// Visibility(
// visible: canEditAppointment(index),
// child: SizedBox(
// width: 500,
// height: 50,
// child: MIHButton(
// onTap: () {
// appointmentUpdateWindow(index);
// },
// buttonText: "Edit",
// buttonColor:
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// textColor:
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
// ),
// ),
// ),
// SizedBox(
// width: 500,
// height: 50,
// child: MIHButton(
// onTap: () {
// addAppointmentCall();
// checkforchange();
// },
// buttonText: "Add",
// buttonColor:
// MzanziInnovationHub.of(context)!.theme.successColor(),
// textColor:
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
// ),
// ),
],
),
); );
}, },
); );
@@ -369,10 +458,10 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) { builder: (context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Update Appointment", windowTitle: "Update Appointment",
windowTools: [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
setState(() { setState(() {
widget.titleController.text = widget.appointmentList[index].title; widget.titleController.text = widget.appointmentList[index].title;
@@ -387,95 +476,70 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
}); });
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
windowBody: [ windowBody: Column(
SizedBox( children: [
// width: 500, SizedBox(
child: MIHTextField( // width: 500,
controller: widget.titleController, child: MIHTextField(
hintText: "Title", controller: widget.titleController,
editable: true, hintText: "Title",
required: true, editable: true,
), required: true,
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHDateField(
controller: widget.dateController,
lableText: "Date",
required: true,
),
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHTimeField(
controller: widget.timeController,
lableText: "Time",
required: true,
),
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
height: 250,
child: MIHMLTextField(
controller: widget.descriptionIDController,
hintText: "Description",
editable: true,
required: true,
),
),
const SizedBox(height: 20),
Wrap(
alignment: WrapAlignment.center,
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(),
),
), ),
// SizedBox( ),
// width: 500, const SizedBox(height: 10),
// height: 50, SizedBox(
// child: MIHButton( // width: 500,
// onTap: () { child: MIHDateField(
// setState(() { controller: widget.dateController,
// widget.titleController.text = lableText: "Date",
// widget.appointmentList[index].title; required: true,
// widget.descriptionIDController.text = ),
// widget.appointmentList[index].description; ),
// widget.dateController.text = widget const SizedBox(height: 10),
// .appointmentList[index].date_time SizedBox(
// .split('T')[0]; // width: 500,
// widget.timeController.text = widget child: MIHTimeField(
// .appointmentList[index].date_time controller: widget.timeController,
// .split('T')[1] lableText: "Time",
// .substring(0, 5); required: true,
// }); ),
// Navigator.of(context).pop(); ),
// }, const SizedBox(height: 10),
// buttonText: "Cancel", SizedBox(
// buttonColor: // width: 500,
// MzanziInnovationHub.of(context)!.theme.errorColor(), height: 250,
// textColor: child: MIHMLTextField(
// MzanziInnovationHub.of(context)!.theme.primaryColor(), controller: widget.descriptionIDController,
// ), hintText: "Description",
// ), editable: true,
], required: true,
) ),
], ),
const SizedBox(height: 20),
Wrap(
alignment: WrapAlignment.center,
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(),
),
),
],
)
],
),
); );
}, },
); );

View File

@@ -6,9 +6,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_layout/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_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_floating_menu.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_error_message.dart';
import 'package:mzansi_innovation_hub/mih_objects/appointment.dart'; import 'package:mzansi_innovation_hub/mih_objects/appointment.dart';
import 'package:mzansi_innovation_hub/mih_objects/business.dart'; import 'package:mzansi_innovation_hub/mih_objects/business.dart';
@@ -101,10 +101,10 @@ class _PatientAccessRequestState extends State<Appointments> {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) { builder: (context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Add Appointment", windowTitle: "Add Appointment",
windowTools: [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
_appointmentDateController.clear(); _appointmentDateController.clear();
@@ -112,61 +112,63 @@ class _PatientAccessRequestState extends State<Appointments> {
_appointmentTitleController.clear(); _appointmentTitleController.clear();
_appointmentDescriptionIDController.clear(); _appointmentDescriptionIDController.clear();
}, },
windowBody: [ windowBody: Column(
SizedBox( children: [
// width: 500, SizedBox(
child: MIHTextField( // width: 500,
controller: _appointmentTitleController, child: MIHTextField(
hintText: "Title", controller: _appointmentTitleController,
editable: true, hintText: "Title",
required: true, editable: true,
required: true,
),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), SizedBox(
SizedBox( // width: 500,
// width: 500, child: MIHDateField(
child: MIHDateField( controller: _appointmentDateController,
controller: _appointmentDateController, lableText: "Date",
lableText: "Date", required: true,
required: true, ),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), SizedBox(
SizedBox( // width: 500,
// width: 500, child: MIHTimeField(
child: MIHTimeField( controller: _appointmentTimeController,
controller: _appointmentTimeController, lableText: "Time",
lableText: "Time", required: true,
required: true, ),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), SizedBox(
SizedBox( // width: 500,
// width: 500, height: 250,
height: 250, child: MIHMLTextField(
child: MIHMLTextField( controller: _appointmentDescriptionIDController,
controller: _appointmentDescriptionIDController, hintText: "Description",
hintText: "Description", editable: true,
editable: true, required: true,
required: true, ),
), ),
), const SizedBox(height: 20),
const SizedBox(height: 20), SizedBox(
SizedBox( width: 500,
width: 500, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { addAppointmentCall();
addAppointmentCall(); },
}, buttonText: "Add",
buttonText: "Add", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.successColor(),
MzanziInnovationHub.of(context)!.theme.successColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), ],
], ),
); );
}, },
); );

View File

@@ -2,6 +2,9 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
// import 'dart:convert'; // import 'dart:convert';
import 'package:flutter_speed_dial/flutter_speed_dial.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';
import 'package:mzansi_innovation_hub/mih_objects/patients.dart'; import 'package:mzansi_innovation_hub/mih_objects/patients.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@@ -21,7 +24,6 @@ import '../../mih_components/mih_layout/mih_header.dart';
import '../../mih_components/mih_layout/mih_layout_builder.dart'; import '../../mih_components/mih_layout/mih_layout_builder.dart';
import '../../mih_components/mih_layout/mih_notification_drawer.dart'; import '../../mih_components/mih_layout/mih_notification_drawer.dart';
import '../../mih_components/mih_layout/mih_tile.dart'; import '../../mih_components/mih_layout/mih_tile.dart';
import '../../mih_components/mih_layout/mih_window.dart';
import '../../mih_components/mih_pop_up_messages/mih_delete_message.dart'; import '../../mih_components/mih_pop_up_messages/mih_delete_message.dart';
import '../../mih_components/mih_pop_up_messages/mih_error_message.dart'; import '../../mih_components/mih_pop_up_messages/mih_error_message.dart';
import '../../mih_components/mih_pop_up_messages/mih_loading_circle.dart'; import '../../mih_components/mih_pop_up_messages/mih_loading_circle.dart';
@@ -844,41 +846,70 @@ class _MIHHomeLegacyState extends State<MIHHomeLegacy> {
// return const MIHErrorMessage(errorType: "User Exists"); // return const MIHErrorMessage(errorType: "User Exists");
// return const MIHErrorMessage(errorType: "Password Match"); // return const MIHErrorMessage(errorType: "Password Match");
// return const MIHErrorMessage(errorType: "Invalid Credentials"); // return const MIHErrorMessage(errorType: "Invalid Credentials");
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: windowTitle:
"Test Window title that is too large for mobile devices", "Test Window title that is too large for mobile devices",
windowBody: const [ windowBody: const Column(
SizedBox( children: [
height: 250, SizedBox(
) height: 250,
], )
windowTools: [ ],
IconButton( ),
onPressed: () { windowTools: Padding(
//deleteFilePopUp(filePath, fileID); padding: const EdgeInsets.only(top: 5.0),
}, child: MihFloatingMenu(
icon: Icon( animatedIcon: AnimatedIcons.menu_close,
Icons.delete, direction: SpeedDialDirection.down,
size: 35, children: [
color: MzanziInnovationHub.of(context)! SpeedDialChild(
.theme child: Icon(
.secondaryColor(), Icons.delete,
), color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
label: "Wallet?",
labelBackgroundColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
labelStyle: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
onTap: () {},
),
SpeedDialChild(
child: Icon(
Icons.delete,
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
label: "Delete File",
labelBackgroundColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
labelStyle: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
onTap: () {},
),
],
), ),
IconButton( ),
onPressed: () {
//deleteFilePopUp(filePath, fileID);
},
icon: Icon(
Icons.wallet,
size: 35,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
],
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },

View File

@@ -1,10 +1,12 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.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_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_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_inputs_and_buttons/mih_text_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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';
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_delete_message.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_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_loading_circle.dart';
@@ -149,80 +151,99 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Employee Details", windowTitle: "Employee Details",
windowTools: [ windowTools: Padding(
IconButton( padding: const EdgeInsets.only(top: 5.0),
onPressed: () { child: MihFloatingMenu(
showDeleteWarning(index); animatedIcon: AnimatedIcons.menu_close,
}, direction: SpeedDialDirection.down,
icon: Icon( children: [
Icons.delete, SpeedDialChild(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), child: Icon(
size: 35, Icons.delete,
), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Employee",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
showDeleteWarning(index);
},
),
],
), ),
], ),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: fnameController, const SizedBox(height: 10.0),
hintText: "First Name", MIHTextField(
editable: false, controller: fnameController,
required: true, hintText: "First Name",
), editable: false,
const SizedBox(height: 10.0), required: true,
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,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.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");
},
);
}
},
), ),
) 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,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.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");
},
);
}
},
),
)
],
),
), ),
); );
} }

View File

@@ -4,7 +4,7 @@ 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_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_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_inputs_and_buttons/mih_text_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_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_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
@@ -124,70 +124,72 @@ class _BuildUserListState extends State<BuildUserList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Add Employee", windowTitle: "Add Employee",
windowBody: [ windowBody: Column(
const SizedBox(height: 10.0), children: [
MIHTextField( const SizedBox(height: 10.0),
controller: fnameController, MIHTextField(
hintText: "Username Name", controller: fnameController,
editable: false, hintText: "Username Name",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.0),
MIHTextField(
controller: lnameController,
hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: typeController,
hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.0),
SizedBox(
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");
},
);
}
},
), ),
), const SizedBox(height: 10.0),
const SizedBox(height: 10.0), MIHTextField(
], controller: lnameController,
windowTools: [], hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: typeController,
hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.0),
SizedBox(
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");
},
);
}
},
),
),
const SizedBox(height: 10.0),
],
),
windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
})); }));

View File

@@ -1,13 +1,15 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; 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_floating_menu.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:supertokens_flutter/http.dart' as http; import 'package:supertokens_flutter/http.dart' as http;
import '../../../../main.dart'; import '../../../../main.dart';
import '../../../../mih_components/mih_inputs_and_buttons/mih_button.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_dropdown_input.dart';
import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
import '../../../../mih_components/mih_layout/mih_window.dart';
import '../../../../mih_components/mih_pop_up_messages/mih_delete_message.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_delete_message.dart';
import '../../../../mih_components/mih_pop_up_messages/mih_error_message.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_error_message.dart';
import '../../../../mih_components/mih_pop_up_messages/mih_loading_circle.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_loading_circle.dart';
@@ -150,80 +152,99 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Employee Details", windowTitle: "Employee Details",
windowTools: [ windowTools: Padding(
IconButton( padding: const EdgeInsets.only(top: 5.0),
onPressed: () { child: MihFloatingMenu(
showDeleteWarning(index); animatedIcon: AnimatedIcons.menu_close,
}, direction: SpeedDialDirection.down,
icon: Icon( children: [
Icons.delete, SpeedDialChild(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), child: Icon(
size: 35, Icons.delete,
), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Employee",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
showDeleteWarning(index);
},
),
],
), ),
], ),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: fnameController, const SizedBox(height: 10.0),
hintText: "First Name", MIHTextField(
editable: false, controller: fnameController,
required: true, hintText: "First Name",
), editable: false,
const SizedBox(height: 10.0), required: true,
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,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.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");
},
);
}
},
), ),
) 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,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.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");
},
);
}
},
),
)
],
),
), ),
); );
// showDialog( // showDialog(

View File

@@ -1,13 +1,13 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:supertokens_flutter/http.dart' as http; import 'package:supertokens_flutter/http.dart' as http;
import '../../../../main.dart'; import '../../../../main.dart';
import '../../../../mih_components/mih_inputs_and_buttons/mih_button.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_dropdown_input.dart';
import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart'; import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
import '../../../../mih_components/mih_layout/mih_window.dart';
import '../../../../mih_components/mih_pop_up_messages/mih_error_message.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_error_message.dart';
import '../../../../mih_components/mih_pop_up_messages/mih_loading_circle.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_loading_circle.dart';
import '../../../../mih_components/mih_pop_up_messages/mih_success_message.dart'; import '../../../../mih_components/mih_pop_up_messages/mih_success_message.dart';
@@ -125,70 +125,72 @@ class _BuildUserListState extends State<BuildUserList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Add Employee", windowTitle: "Add Employee",
windowBody: [ windowBody: Column(
const SizedBox(height: 10.0), children: [
MIHTextField( const SizedBox(height: 10.0),
controller: fnameController, MIHTextField(
hintText: "Username Name", controller: fnameController,
editable: false, hintText: "Username Name",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.0),
MIHTextField(
controller: lnameController,
hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: typeController,
hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.0),
SizedBox(
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");
},
);
}
},
), ),
), const SizedBox(height: 10.0),
const SizedBox(height: 10.0), MIHTextField(
], controller: lnameController,
windowTools: [], hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: typeController,
hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: accessController,
hintText: "Access",
dropdownOptions: const ["Full", "Partial"],
required: true,
editable: true,
enableSearch: false,
),
const SizedBox(height: 15.0),
SizedBox(
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");
},
);
}
},
),
),
const SizedBox(height: 10.0),
],
),
windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
})); }));

View File

@@ -4,7 +4,6 @@ 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_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_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_inputs_and_buttons/mih_text_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_alert.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_package_window.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_floating_menu.dart';
@@ -50,85 +49,86 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Edit Loyalty Card", windowTitle: "Edit Loyalty Card",
windowTools: const [ windowTools: null,
SizedBox(width: 35),
],
onWindowTapClose: () { onWindowTapClose: () {
_cardNumberController.clear(); _cardNumberController.clear();
_nicknameController.clear(); _nicknameController.clear();
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: _nicknameController, MIHTextField(
hintText: "Card Title", controller: _nicknameController,
editable: true, hintText: "Card Title",
required: false, editable: true,
), required: false,
const SizedBox(height: 10), ),
Row( const SizedBox(height: 10),
mainAxisAlignment: MainAxisAlignment.center, Row(
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center,
children: [ mainAxisSize: MainAxisSize.max,
Flexible( children: [
child: MIHNumberField( Flexible(
controller: _cardNumberController, child: MIHNumberField(
hintText: "Card Number", controller: _cardNumberController,
editable: true, hintText: "Card Number",
required: true, editable: true,
enableDecimal: false, required: true,
enableDecimal: false,
),
), ),
), const SizedBox(width: 10),
const SizedBox(width: 10), MIHButton(
MIHButton( onTap: () async {
onTap: () async { openscanner();
openscanner(); },
buttonText: "Scan",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
],
),
const SizedBox(height: 15),
SizedBox(
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: "Scan", buttonText: "Update",
buttonColor: buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor: textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(), MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
],
),
const SizedBox(height: 15),
SizedBox(
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(),
), ),
), ],
], ),
), ),
); );
} }
@@ -279,98 +279,88 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
builder: (context) => MihPackageWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: widget.cardList[index].shop_name.toUpperCase(), windowTitle: widget.cardList[index].shop_name.toUpperCase(),
windowTools: Row( windowTools: Padding(
children: [ padding: const EdgeInsets.only(top: 5.0),
Padding( child: MihFloatingMenu(
padding: const EdgeInsets.only(top: 5.0), animatedIcon: AnimatedIcons.menu_close,
child: MihFloatingMenu( direction: SpeedDialDirection.down,
animatedIcon: AnimatedIcons.menu_close, children: [
direction: SpeedDialDirection.down, SpeedDialChild(
children: [ child: widget.cardList[index].favourite == ""
SpeedDialChild( ? Icon(
child: widget.cardList[index].favourite == "" Icons.favorite,
? Icon( color: MzanziInnovationHub.of(context)!
Icons.favorite, .theme
color: MzanziInnovationHub.of(context)! .primaryColor(),
.theme )
.primaryColor(), : Icon(
) Icons.favorite_border,
: Icon( color: MzanziInnovationHub.of(context)!
Icons.favorite_border, .theme
color: MzanziInnovationHub.of(context)! .primaryColor(),
.theme ),
.primaryColor(), label: widget.cardList[index].favourite == ""
), ? "Add to Favourite"
label: widget.cardList[index].favourite == "" : "Remove from Favourite",
? "Add to Favourite" labelBackgroundColor:
: "Remove from Favourite", MzanziInnovationHub.of(context)!.theme.successColor(),
labelBackgroundColor: labelStyle: TextStyle(
MzanziInnovationHub.of(context)!.theme.successColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
labelStyle: TextStyle( fontWeight: FontWeight.bold,
color: ),
MzanziInnovationHub.of(context)!.theme.primaryColor(), backgroundColor:
fontWeight: FontWeight.bold, MzanziInnovationHub.of(context)!.theme.successColor(),
), onTap: () {
backgroundColor: if (widget.cardList[index].favourite == "") {
MzanziInnovationHub.of(context)!.theme.successColor(), addToFavCardWindow(context, index);
onTap: () { } else {
if (widget.cardList[index].favourite == "") { removeFromFavCardWindow(context, index);
addToFavCardWindow(context, index); }
} else { },
removeFromFavCardWindow(context, index);
}
},
),
SpeedDialChild(
child: Icon(
Icons.edit,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Edit Card Details",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
setState(() {
_cardNumberController.text =
widget.cardList[index].card_number;
_nicknameController.text =
widget.cardList[index].nickname;
});
editCardWindow(context, index);
},
),
SpeedDialChild(
child: Icon(
Icons.delete,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Card",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
deleteCardWindow(context, index);
},
),
],
), ),
), SpeedDialChild(
], child: Icon(
Icons.edit,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Edit Card Details",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
setState(() {
_cardNumberController.text =
widget.cardList[index].card_number;
_nicknameController.text = widget.cardList[index].nickname;
});
editCardWindow(context, index);
},
),
SpeedDialChild(
child: Icon(
Icons.delete,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Card",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
deleteCardWindow(context, index);
},
),
],
),
), ),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);

View File

@@ -7,9 +7,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_layout/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_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_floating_menu.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_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_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart'; import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
@@ -81,21 +81,10 @@ class _MihCardsState extends State<MihCards> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Add New Loyalty Card", windowTitle: "Add New Loyalty Card",
windowTools: const [ windowTools: null,
SizedBox(width: 35),
// IconButton(
// onPressed: () {
// //Delete card API Call
// },
// icon: Icon(
// Icons.delete,
// color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// ),
// ),
],
onWindowTapClose: () { onWindowTapClose: () {
shopController.clear(); shopController.clear();
cardNumberController.clear(); cardNumberController.clear();
@@ -103,145 +92,148 @@ class _MihCardsState extends State<MihCards> {
shopName.value = ""; shopName.value = "";
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHDropdownField( children: [
controller: shopController, MIHDropdownField(
hintText: "Shop Name", controller: shopController,
dropdownOptions: const [ hintText: "Shop Name",
"+More", dropdownOptions: const [
"Apple Tree", "+More",
"Auchan", "Apple Tree",
"Best Before", "Auchan",
"Big Save", "Best Before",
"Boxer", "Big Save",
"BP", "Boxer",
"Builders Warehouse", "BP",
"Checkers", "Builders Warehouse",
"Choppies", "Checkers",
"Clicks", "Choppies",
"Continente", "Clicks",
"Cotton:On", "Continente",
"Carrefour", "Cotton:On",
"Dis-Chem", "Carrefour",
"Edgars", "Dis-Chem",
"Eskom", "Edgars",
"Exclusive Books", "Eskom",
"Fresh Stop", "Exclusive Books",
"Fresmart", "Fresh Stop",
"Infinity", "Fresmart",
"Jet", "Infinity",
"Justrite", "Jet",
"Kero", "Justrite",
"Leroy Merlin", "Kero",
"Makro", "Leroy Merlin",
"Naivas", "Makro",
"OK Foods", "Naivas",
"Panarottis", "OK Foods",
"Pick n Pay", "Panarottis",
"PnA", "Pick n Pay",
"PQ Clothing", "PnA",
"Rage", "PQ Clothing",
"Sefalana", "Rage",
"Sasol", "Sefalana",
"Shell", "Sasol",
"Shoprite", "Shell",
"Signature Cosmetics & Fragrances", "Shoprite",
"Spar", "Signature Cosmetics & Fragrances",
"Spur", "Spar",
"TFG Group", "Spur",
"Toys R Us", "TFG Group",
"Woermann Brock", "Toys R Us",
"Woolworths" "Woermann Brock",
], "Woolworths"
required: true, ],
editable: true, required: true,
enableSearch: false, editable: true,
), enableSearch: false,
ValueListenableBuilder( ),
valueListenable: shopName, ValueListenableBuilder(
builder: (BuildContext context, String value, Widget? child) { valueListenable: shopName,
return Visibility( builder: (BuildContext context, String value, Widget? child) {
visible: value != "", return Visibility(
child: Column( visible: value != "",
children: [ child: Column(
const SizedBox(height: 10), children: [
MihCardDisplay( const SizedBox(height: 10),
shopName: shopName.value, nickname: "", height: 200), MihCardDisplay(
], shopName: shopName.value, nickname: "", height: 200),
],
),
);
},
),
const SizedBox(height: 10),
MIHTextField(
controller: _nicknameController,
hintText: "Card Title",
editable: true,
required: false,
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Flexible(
child: MIHNumberField(
controller: cardNumberController,
hintText: "Card Number",
editable: true,
required: true,
enableDecimal: false,
),
), ),
); const SizedBox(width: 10),
}, MIHButton(
), onTap: () async {
const SizedBox(height: 10), openscanner();
MIHTextField( },
controller: _nicknameController, buttonText: "Scan",
hintText: "Card Title", buttonColor:
editable: true, MzanziInnovationHub.of(context)!.theme.secondaryColor(),
required: false, textColor:
), MzanziInnovationHub.of(context)!.theme.primaryColor(),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Flexible(
child: MIHNumberField(
controller: cardNumberController,
hintText: "Card Number",
editable: true,
required: true,
enableDecimal: false,
), ),
), ],
const SizedBox(width: 10), ),
MIHButton( const SizedBox(height: 15),
onTap: () async { SizedBox(
openscanner(); 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: "Scan", buttonText: "Add",
buttonColor: buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor: textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(), MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
],
),
const SizedBox(height: 15),
SizedBox(
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(),
), ),
), ],
], ),
), ),
); );
} }

View File

@@ -6,7 +6,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_inputs_and_buttons/mih_time_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_error_message.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
@@ -167,75 +167,78 @@ class _BuildPatientsListState extends State<BuildMihPatientSearchList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Patient Appointment", windowTitle: "Patient Appointment",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: idController, MIHTextField(
hintText: "ID No.", controller: idController,
editable: false, hintText: "ID No.",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.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),
MIHDateField(
controller: dateController,
lableText: "Date",
required: true,
),
const SizedBox(height: 10.0),
MIHTimeField(
controller: timeController,
lableText: "Time",
required: true,
),
const SizedBox(height: 30.0),
SizedBox(
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");
},
);
}
},
), ),
) const SizedBox(height: 10.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),
MIHDateField(
controller: dateController,
lableText: "Date",
required: true,
),
const SizedBox(height: 10.0),
MIHTimeField(
controller: timeController,
lableText: "Time",
required: true,
),
const SizedBox(height: 30.0),
SizedBox(
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");
},
);
}
},
),
)
],
),
), ),
); );
} }
@@ -321,226 +324,231 @@ class _BuildPatientsListState extends State<BuildMihPatientSearchList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Patient Profile", windowTitle: "Patient Profile",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: idController, MIHTextField(
hintText: "ID No.", controller: idController,
editable: false, hintText: "ID No.",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.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),
MIHTextField(
controller: accessStatusController,
hintText: "Access Status",
editable: false,
required: true,
),
const SizedBox(height: 20.0),
Visibility(
visible: !hasAccess,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"Important Notice: Requesting Patient Profile Access",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
Text(
"You are about to request access to a patient's profile. Please be aware of the following important points:",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
SizedBox(
width: 600,
child: Text(
"1. Permanent Access: Once the patient accepts your access request, it will become permanent.",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
),
SizedBox(
width: 600,
child: Text(
"2. Shared Information: Any updates you make to the patient's profile will be visible to others who have access to the profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
),
SizedBox(
width: 600,
child: Text(
"3. Irreversible Access: Once granted, you cannot revoke your access to the patient's profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
),
Text(
"By pressing the \"Request Access\" button you accept the above terms.\n",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
],
), ),
), const SizedBox(height: 10.0),
// const SizedBox(height: 15.0), MIHTextField(
Wrap(runSpacing: 10, spacing: 10, children: [ controller: fnameController,
// Visibility( hintText: "First Name",
// visible: hasAccess, editable: false,
// child: SizedBox( required: true,
// 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(
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();
}
},
),
),
), ),
const SizedBox(height: 10.0),
MIHTextField(
controller: lnameController,
hintText: "Surname",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: accessStatusController,
hintText: "Access Status",
editable: false,
required: true,
),
const SizedBox(height: 20.0),
Visibility( Visibility(
visible: !hasAccess && accessStatus == "No Access", visible: !hasAccess,
child: SizedBox( child: Column(
width: 300, mainAxisSize: MainAxisSize.max,
height: 50, mainAxisAlignment: MainAxisAlignment.start,
child: MIHButton( children: [
buttonText: "Request Access", Text(
buttonColor: "Important Notice: Requesting Patient Profile Access",
MzanziInnovationHub.of(context)!.theme.successColor(), style: TextStyle(
textColor: fontWeight: FontWeight.bold,
MzanziInnovationHub.of(context)!.theme.primaryColor(), color:
onTap: () { MzanziInnovationHub.of(context)!.theme.errorColor(),
//print("Send access Request..."); ),
MIHApiCalls.addPatientAccessAPICall( ),
widget.business!.business_id, Text(
widget.patients[index].app_id, "You are about to request access to a patient's profile. Please be aware of the following important points:",
"patient", style: TextStyle(
widget.business!.Name, fontWeight: FontWeight.normal,
widget.personalSelected, color:
BusinessArguments( MzanziInnovationHub.of(context)!.theme.errorColor(),
widget.signedInUser, ),
widget.businessUser, ),
widget.business, SizedBox(
width: 600,
child: Text(
"1. Permanent Access: Once the patient accepts your access request, it will become permanent.",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
), ),
context, ),
); ),
}, SizedBox(
), width: 600,
), child: Text(
), "2. Shared Information: Any updates you make to the patient's profile will be visible to others who have access to the profile.",
Visibility( style: TextStyle(
visible: !hasAccess && accessStatus == "declined", fontWeight: FontWeight.normal,
child: SizedBox( color:
width: 300, MzanziInnovationHub.of(context)!.theme.errorColor(),
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, ),
); ),
}, SizedBox(
width: 600,
child: Text(
"3. Irreversible Access: Once granted, you cannot revoke your access to the patient's profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
),
Text(
"By pressing the \"Request Access\" button you accept the above terms.\n",
style: TextStyle(
fontWeight: FontWeight.bold,
color:
MzanziInnovationHub.of(context)!.theme.errorColor(),
),
),
],
),
),
// 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(
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();
}
},
),
), ),
), ),
), Visibility(
Visibility( visible: !hasAccess && accessStatus == "No Access",
visible: !hasAccess && accessStatus == "pending", child: SizedBox(
child: const SizedBox( width: 300,
width: 500, height: 50,
//height: 50, child: MIHButton(
child: Text( buttonText: "Request Access",
"Patient has not approved access to their profile. Once access has been approved you can book and appointment or view their profile."), 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,
);
},
),
),
), ),
), Visibility(
]) visible: !hasAccess && accessStatus == "declined",
], child: SizedBox(
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,
);
},
),
),
),
Visibility(
visible: !hasAccess && accessStatus == "pending",
child: const SizedBox(
width: 500,
//height: 50,
child: Text(
"Patient has not approved access to their profile. Once access has been approved you can book and appointment or view their profile."),
),
),
])
],
),
), ),
); );
} }

View File

@@ -5,7 +5,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_inputs_and_buttons/mih_time_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_error_message.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
import 'package:mzansi_innovation_hub/mih_env/env.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart';
@@ -100,75 +100,78 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Patient Appointment", windowTitle: "Patient Appointment",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: idController, MIHTextField(
hintText: "ID No.", controller: idController,
editable: false, hintText: "ID No.",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.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),
MIHDateField(
controller: dateController,
lableText: "Date",
required: true,
),
const SizedBox(height: 10.0),
MIHTimeField(
controller: timeController,
lableText: "Time",
required: true,
),
const SizedBox(height: 30.0),
SizedBox(
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");
},
);
}
},
), ),
) const SizedBox(height: 10.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),
MIHDateField(
controller: dateController,
lableText: "Date",
required: true,
),
const SizedBox(height: 10.0),
MIHTimeField(
controller: timeController,
lableText: "Time",
required: true,
),
const SizedBox(height: 30.0),
SizedBox(
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");
},
);
}
},
),
)
],
),
), ),
); );
} }
@@ -214,74 +217,76 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Patient Profile", windowTitle: "Patient Profile",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: idController, MIHTextField(
hintText: "ID No.", controller: idController,
editable: false, hintText: "ID No.",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.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: 30.0),
Wrap(runSpacing: 10, spacing: 10, children: [
SizedBox(
width: 300,
height: 50,
child: MIHButton(
buttonText: "Book Appointment",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
onTap: () {
appointmentPopUp(index);
},
),
), ),
SizedBox( const SizedBox(height: 10.0),
width: 300, MIHTextField(
height: 50, controller: fnameController,
child: MIHButton( hintText: "First Name",
buttonText: "View Patient Profile", editable: false,
buttonColor: required: true,
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",
));
},
),
), ),
]) const SizedBox(height: 10.0),
], MIHTextField(
controller: lnameController,
hintText: "Surname",
editable: false,
required: true,
),
const SizedBox(height: 30.0),
Wrap(runSpacing: 10, spacing: 10, children: [
SizedBox(
width: 300,
height: 50,
child: MIHButton(
buttonText: "Book Appointment",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
onTap: () {
appointmentPopUp(index);
},
),
),
SizedBox(
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",
));
},
),
),
])
],
),
), ),
); );
} }

View File

@@ -8,9 +8,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_layout/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_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_floating_menu.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_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_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_env/env.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart';
@@ -222,71 +222,74 @@ class _WaitingRoomState extends State<WaitingRoom> {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) { builder: (context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Appointment Type", windowTitle: "Appointment Type",
windowTools: [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
windowBody: [ windowBody: Column(
Text( children: [
question, Text(
style: TextStyle( question,
fontSize: 20, style: TextStyle(
color: fontSize: 20,
MzanziInnovationHub.of(context)!.theme.secondaryColor()), color: MzanziInnovationHub.of(context)!
textAlign: TextAlign.left, .theme
), .secondaryColor()),
const SizedBox(height: 15), textAlign: TextAlign.left,
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(),
), ),
), const SizedBox(height: 15),
const SizedBox(height: 10), SizedBox(
SizedBox( width: 500,
width: 500, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { widget.onIndexChange(1);
widget.onIndexChange(2); Navigator.of(context).pop();
Navigator.of(context).pop(); },
}, buttonText: "Existing Patient",
buttonText: "Existing MIH User", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
MzanziInnovationHub.of(context)!.theme.secondaryColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), SizedBox(
SizedBox( width: 500,
width: 500, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { widget.onIndexChange(2);
Navigator.pop(context); Navigator.of(context).pop();
addAppointmentWindow(); },
}, buttonText: "Existing MIH User",
buttonText: "Skeleton Appointment", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
MzanziInnovationHub.of(context)!.theme.secondaryColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), 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(),
),
),
],
),
); );
}, },
); );
@@ -297,10 +300,10 @@ class _WaitingRoomState extends State<WaitingRoom> {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) { builder: (context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Add Appointment", windowTitle: "Add Appointment",
windowTools: [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
_appointmentDateController.clear(); _appointmentDateController.clear();
@@ -309,61 +312,63 @@ class _WaitingRoomState extends State<WaitingRoom> {
_appointmentDescriptionIDController.clear(); _appointmentDescriptionIDController.clear();
_patientController.clear(); _patientController.clear();
}, },
windowBody: [ windowBody: Column(
SizedBox( children: [
// width: 500, SizedBox(
child: MIHTextField( // width: 500,
controller: _appointmentTitleController, child: MIHTextField(
hintText: "Title", controller: _appointmentTitleController,
editable: true, hintText: "Title",
required: true, editable: true,
required: true,
),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), SizedBox(
SizedBox( // width: 500,
// width: 500, child: MIHDateField(
child: MIHDateField( controller: _appointmentDateController,
controller: _appointmentDateController, lableText: "Date",
lableText: "Date", required: true,
required: true, ),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), SizedBox(
SizedBox( // width: 500,
// width: 500, child: MIHTimeField(
child: MIHTimeField( controller: _appointmentTimeController,
controller: _appointmentTimeController, lableText: "Time",
lableText: "Time", required: true,
required: true, ),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), SizedBox(
SizedBox( // width: 500,
// width: 500, height: 250,
height: 250, child: MIHMLTextField(
child: MIHMLTextField( controller: _appointmentDescriptionIDController,
controller: _appointmentDescriptionIDController, hintText: "Description",
hintText: "Description", editable: true,
editable: true, required: true,
required: true, ),
), ),
), const SizedBox(height: 20),
const SizedBox(height: 20), SizedBox(
SizedBox( width: 500,
width: 500, height: 50,
height: 50, child: MIHButton(
child: MIHButton( onTap: () {
onTap: () { addAppointmentCall();
addAppointmentCall(); },
}, buttonText: "Add",
buttonText: "Add", buttonColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.successColor(),
MzanziInnovationHub.of(context)!.theme.successColor(), textColor:
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.primaryColor(), ),
), ),
), ],
], ),
); );
}, },
); );

View File

@@ -6,7 +6,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_inputs_and_buttons/mih_text_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_error_message.dart';
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart'; import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart'; import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
@@ -389,10 +389,10 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Generate Claim/ Statement Document", windowTitle: "Generate Claim/ Statement Document",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
// medicineController.clear(); // medicineController.clear();
// quantityController.clear(); // quantityController.clear();
@@ -402,9 +402,7 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
// noRepeatsController.clear(); // noRepeatsController.clear();
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: getWindowBody(),
getWindowBody(),
],
); );
} }
} }

View File

@@ -1,5 +1,5 @@
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_text_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_objects/icd10_code.dart.dart'; import 'package:mzansi_innovation_hub/mih_objects/icd10_code.dart.dart';
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/list_builders/build_icd10_code_list.dart'; import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/list_builders/build_icd10_code_list.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -37,10 +37,10 @@ class _ICD10SearchWindowState extends State<ICD10SearchWindow> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "ICD-10 Search", windowTitle: "ICD-10 Search",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
// medicineController.clear(); // medicineController.clear();
// quantityController.clear(); // quantityController.clear();
@@ -50,9 +50,7 @@ class _ICD10SearchWindowState extends State<ICD10SearchWindow> {
// noRepeatsController.clear(); // noRepeatsController.clear();
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: getWindowBody(),
getWindowBody(),
],
); );
} }
} }

View File

@@ -1,6 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_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_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_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_env/env.dart'; import 'package:mzansi_innovation_hub/mih_env/env.dart';
@@ -66,47 +65,49 @@ class _MedicineSearchState extends State<MedicineSearch> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MIHWindow( return MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Select Medicine", windowTitle: "Select Medicine",
windowTools: [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
FutureBuilder( children: [
future: futueMeds, FutureBuilder(
builder: (context, snapshot) { future: futueMeds,
if (snapshot.connectionState == ConnectionState.waiting) { builder: (context, snapshot) {
return const SizedBox( if (snapshot.connectionState == ConnectionState.waiting) {
height: 400, return const SizedBox(
child: Mihloadingcircle(), height: 400,
); child: Mihloadingcircle(),
} else if (snapshot.hasData && snapshot.data!.isNotEmpty) { );
final medsList = snapshot.data!; } else if (snapshot.hasData && snapshot.data!.isNotEmpty) {
return SizedBox( final medsList = snapshot.data!;
height: 400, return SizedBox(
child: BuildMedicinesList( height: 400,
contoller: widget.searchVlaue, child: BuildMedicinesList(
medicines: medsList, contoller: widget.searchVlaue,
//searchString: searchString, medicines: medsList,
), //searchString: searchString,
);
} else {
return const SizedBox(
height: 400,
child: Center(
child: Text(
"No Match Found\nPlease close and manually capture medicine",
style: TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center,
), ),
), );
); } else {
} return const SizedBox(
}, height: 400,
), child: Center(
], child: Text(
"No Match Found\nPlease close and manually capture medicine",
style: TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center,
),
),
);
}
},
),
],
),
); );
} }
} }

View File

@@ -1,7 +1,9 @@
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart'; 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_claim_statement_generation_api.dart';
import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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';
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_delete_message.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_error_message.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
@@ -113,34 +115,68 @@ class _BuildClaimStatementFileListState
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: true, fullscreen: true,
windowTitle: fileName, windowTitle: fileName,
windowBody: [ windowBody: Column(
BuildFileView( children: [
link: url, BuildFileView(
path: filePath, link: url,
//pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath', path: filePath,
), //pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath',
const SizedBox( ),
height: 10, const SizedBox(
) height: 10,
], )
windowTools: [ ],
Visibility( ),
visible: hasAccessToDelete, windowTools: Visibility(
child: IconButton( visible: hasAccessToDelete,
onPressed: () { child: Padding(
deleteFilePopUp(filePath, fileID); padding: const EdgeInsets.only(top: 5.0),
}, child: MihFloatingMenu(
icon: Icon( animatedIcon: AnimatedIcons.menu_close,
size: 35, direction: SpeedDialDirection.down,
Icons.delete, children: [
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), SpeedDialChild(
), child: Icon(
Icons.delete,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Document",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
deleteFilePopUp(filePath, fileID);
},
),
],
), ),
), ),
], ),
// [
// Visibility(
// visible: hasAccessToDelete,
// child: IconButton(
// onPressed: () {
// deleteFilePopUp(filePath, fileID);
// },
// icon: Icon(
// size: 35,
// Icons.delete,
// color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// ),
// ),
// ),
// ],
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },

View File

@@ -1,8 +1,10 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.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_file_api.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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';
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_delete_message.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_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_loading_circle.dart';
@@ -166,34 +168,53 @@ class _BuildFilesListState extends State<BuildFilesList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: true, fullscreen: true,
windowTitle: fileName, windowTitle: fileName,
windowBody: [ windowBody: Column(
BuildFileView( children: [
link: url, BuildFileView(
path: filePath, link: url,
//pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath', path: filePath,
), //pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath',
const SizedBox( ),
height: 10, const SizedBox(
) height: 10,
], )
windowTools: [ ],
Visibility( ),
visible: hasAccessToDelete, windowTools: Visibility(
child: IconButton( visible: hasAccessToDelete,
onPressed: () { child: Padding(
deleteFilePopUp(filePath, fileID); padding: const EdgeInsets.only(top: 5.0),
}, child: MihFloatingMenu(
icon: Icon( animatedIcon: AnimatedIcons.menu_close,
size: 35, direction: SpeedDialDirection.down,
Icons.delete, children: [
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), SpeedDialChild(
), child: Icon(
Icons.delete,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Document",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
deleteFilePopUp(filePath, fileID);
},
),
],
), ),
), ),
], ),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },

View File

@@ -1,9 +1,11 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/main.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_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_text_input.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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';
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_delete_message.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_error_message.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
@@ -136,64 +138,84 @@ class _BuildNotesListState extends State<BuildNotesList> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: true, fullscreen: true,
windowTitle: selectednote.note_name, windowTitle: selectednote.note_name,
windowTools: [ windowTools: Visibility(
Visibility( visible: hasAccessToDelete,
visible: hasAccessToDelete, child: Padding(
child: IconButton( padding: const EdgeInsets.only(top: 5.0),
onPressed: () { child: MihFloatingMenu(
deletePatientPopUp(selectednote.idpatient_notes); animatedIcon: AnimatedIcons.menu_close,
}, direction: SpeedDialDirection.down,
icon: Icon( children: [
Icons.delete, SpeedDialChild(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), child: Icon(
), Icons.delete,
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Delete Document",
labelBackgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
deletePatientPopUp(selectednote.idpatient_notes);
},
),
],
), ),
), ),
], ),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: businessNameController, MIHTextField(
hintText: "Office", controller: businessNameController,
editable: false, hintText: "Office",
required: false,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: userNameController,
hintText: "Created By",
editable: false,
required: false,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: dateController,
hintText: "Created Date",
editable: false,
required: false,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: noteTitleController,
hintText: "Note Title",
editable: false,
required: false,
),
const SizedBox(height: 10.0),
Expanded(
child: MIHMLTextField(
controller: noteTextController,
hintText: "Note Details",
editable: false, editable: false,
required: false, required: false,
), ),
), const SizedBox(height: 10.0),
], MIHTextField(
controller: userNameController,
hintText: "Created By",
editable: false,
required: false,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: dateController,
hintText: "Created Date",
editable: false,
required: false,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: noteTitleController,
hintText: "Note Title",
editable: false,
required: false,
),
const SizedBox(height: 10.0),
Expanded(
child: MIHMLTextField(
controller: noteTextController,
hintText: "Note Details",
editable: false,
required: false,
),
),
],
),
), ),
); );
// showDialog( // showDialog(

View File

@@ -5,9 +5,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
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_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_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_layout/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_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_floating_menu.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_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_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
@@ -84,106 +84,109 @@ class _PatientConsultationState extends State<PatientConsultation> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Add Note", windowTitle: "Add Note",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
titleController.clear(); titleController.clear();
noteTextController.clear(); noteTextController.clear();
}, },
windowBody: [ windowBody: Column(
MIHTextField( children: [
controller: officeController, MIHTextField(
hintText: "Office", controller: officeController,
editable: false, hintText: "Office",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.0), ),
MIHTextField( const SizedBox(height: 10.0),
controller: doctorController, MIHTextField(
hintText: "Created By", controller: doctorController,
editable: false, hintText: "Created By",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.0), ),
MIHTextField( const SizedBox(height: 10.0),
controller: dateController, MIHTextField(
hintText: "Created Date", controller: dateController,
editable: false, hintText: "Created Date",
required: true, editable: false,
), required: true,
const SizedBox(height: 10.0), ),
MIHTextField( const SizedBox(height: 10.0),
controller: titleController, MIHTextField(
hintText: "Note Title", controller: titleController,
editable: true, hintText: "Note Title",
required: true,
),
const SizedBox(height: 10.0),
SizedBox(
//width: 700,
height: 250,
child: MIHMLTextField(
controller: noteTextController,
hintText: "Note Details",
editable: true, editable: true,
required: true, required: true,
), ),
), const SizedBox(height: 10.0),
SizedBox( SizedBox(
height: 15, //width: 700,
child: ValueListenableBuilder( height: 250,
builder: (BuildContext context, int value, Widget? child) { child: MIHMLTextField(
return Row( controller: noteTextController,
mainAxisSize: MainAxisSize.max, hintText: "Note Details",
mainAxisAlignment: MainAxisAlignment.end, editable: true,
children: [ required: true,
Text( ),
"$value",
style: TextStyle(
color: getNoteDetailLimitColor(),
),
),
const SizedBox(width: 5),
Text(
"/512",
style: TextStyle(
color: getNoteDetailLimitColor(),
),
),
],
);
},
valueListenable: _counter,
), ),
), SizedBox(
const SizedBox(height: 15.0), height: 15,
SizedBox( child: ValueListenableBuilder(
width: 300, builder: (BuildContext context, int value, Widget? child) {
height: 50, return Row(
child: MIHButton( mainAxisSize: MainAxisSize.max,
onTap: () { mainAxisAlignment: MainAxisAlignment.end,
if (isFieldsFilled()) { children: [
addPatientNoteAPICall(); Text(
Navigator.pop(context); "$value",
} else { style: TextStyle(
showDialog( color: getNoteDetailLimitColor(),
context: context, ),
builder: (context) { ),
return const MIHErrorMessage(errorType: "Input Error"); const SizedBox(width: 5),
}, Text(
"/512",
style: TextStyle(
color: getNoteDetailLimitColor(),
),
),
],
); );
} },
}, valueListenable: _counter,
buttonText: "Add Note", ),
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
) const SizedBox(height: 15.0),
], SizedBox(
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(),
),
)
],
),
), ),
); );
} }

View File

@@ -7,9 +7,9 @@ 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_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_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_layout/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.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_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_floating_menu.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_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_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
@@ -221,62 +221,65 @@ class _PatientDocumentsState extends State<PatientDocuments> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Upload File", windowTitle: "Upload File",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
MIHFileField( children: [
controller: selectedFileController, MIHFileField(
hintText: "Select File", controller: selectedFileController,
editable: false, hintText: "Select File",
required: true, editable: false,
onPressed: () async { required: true,
FilePickerResult? result = await FilePicker.platform.pickFiles( onPressed: () async {
type: FileType.custom, FilePickerResult? result = await FilePicker.platform.pickFiles(
allowedExtensions: ['jpg', 'png', 'pdf'], type: FileType.custom,
withData: true, allowedExtensions: ['jpg', 'png', 'pdf'],
); withData: true,
if (result == null) return; );
final selectedFile = result.files.first; if (result == null) return;
print("Selected file: $selectedFile"); final selectedFile = result.files.first;
setState(() { print("Selected file: $selectedFile");
selected = selectedFile; setState(() {
}); selected = selectedFile;
setState(() { });
selectedFileController.text = selectedFile.name; setState(() {
}); selectedFileController.text = selectedFile.name;
}, });
),
const SizedBox(height: 15),
SizedBox(
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");
},
);
}
}, },
), ),
) const SizedBox(height: 15),
], SizedBox(
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");
},
);
}
},
),
)
],
),
), ),
); );
} }
@@ -285,44 +288,47 @@ class _PatientDocumentsState extends State<PatientDocuments> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Create Medical Certificate", windowTitle: "Create Medical Certificate",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
Medcertinput( children: [
startDateController: startDateController, Medcertinput(
endDateTextController: endDateTextController, startDateController: startDateController,
retDateTextController: retDateTextController, endDateTextController: endDateTextController,
), retDateTextController: retDateTextController,
const SizedBox(height: 15.0),
SizedBox(
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");
},
);
}
},
), ),
) const SizedBox(height: 15.0),
], SizedBox(
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");
},
);
}
},
),
)
],
),
), ),
); );
} }
@@ -331,10 +337,10 @@ class _PatientDocumentsState extends State<PatientDocuments> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => MIHWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Create Prescription", windowTitle: "Create Prescription",
windowTools: const [], windowTools: null,
onWindowTapClose: () { onWindowTapClose: () {
medicineController.clear(); medicineController.clear();
quantityController.clear(); quantityController.clear();
@@ -344,22 +350,24 @@ class _PatientDocumentsState extends State<PatientDocuments> {
noRepeatsController.clear(); noRepeatsController.clear();
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: [ windowBody: Column(
PrescripInput( children: [
medicineController: medicineController, PrescripInput(
quantityController: quantityController, medicineController: medicineController,
dosageController: dosageController, quantityController: quantityController,
timesDailyController: timesDailyController, dosageController: dosageController,
noDaysController: noDaysController, timesDailyController: timesDailyController,
noRepeatsController: noRepeatsController, noDaysController: noDaysController,
outputController: outputController, noRepeatsController: noRepeatsController,
selectedPatient: widget.selectedPatient, outputController: outputController,
signedInUser: widget.signedInUser, selectedPatient: widget.selectedPatient,
business: widget.business, signedInUser: widget.signedInUser,
businessUser: widget.businessUser, business: widget.business,
env: env, businessUser: widget.businessUser,
), env: env,
], ),
],
),
), ),
); );
} }

View File

@@ -50,7 +50,7 @@ class _MIHTestState extends State<MIHTest> {
], ],
), ),
secondaryActionButton: null, secondaryActionButton: null,
body: MIHBody( body: const MIHBody(
borderOn: false, borderOn: false,
bodyItems: [ bodyItems: [
// YoutubePlayer( // YoutubePlayer(
@@ -64,18 +64,5 @@ class _MIHTestState extends State<MIHTest> {
pullDownToRefresh: false, pullDownToRefresh: false,
onPullDown: () async {}, onPullDown: () async {},
); );
// return MIHWindow(
// fullscreen: false,
// windowTitle: "Test",
// windowTools: const [],
// onWindowTapClose: () {
// Navigator.pop(context);
// },
// windowBody: [
// YoutubePlayer(
// controller: videoController,
// ),
// ],
// );
} }
} }