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