forked from yaso_meth/mih-project
Merge pull request #182 from yaso-meth/QoL--Package-window-Component-update
QoL--Package-window-Component-update
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_yt_video_player.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../main.dart';
|
||||
import 'mih_window.dart';
|
||||
|
||||
class MIHTile extends StatefulWidget {
|
||||
final String tileName;
|
||||
@@ -47,16 +47,17 @@ class _MIHTileState extends State<MIHTile> {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: widget.tileName,
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHYTVideoPlayer(videoYTLink: widget.videoID!),
|
||||
],
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHYTVideoPlayer(videoYTLink: widget.videoID!),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
class MIHWindow extends StatefulWidget {
|
||||
final String windowTitle;
|
||||
final List<Widget> windowBody;
|
||||
final List<Widget> windowTools;
|
||||
final void Function() onWindowTapClose;
|
||||
final bool fullscreen;
|
||||
const MIHWindow({
|
||||
super.key,
|
||||
required this.fullscreen,
|
||||
required this.windowTitle,
|
||||
required this.windowTools,
|
||||
required this.onWindowTapClose,
|
||||
required this.windowBody,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHWindow> createState() => _MIHWindowState();
|
||||
}
|
||||
|
||||
class _MIHWindowState extends State<MIHWindow> {
|
||||
late double windowTitleSize;
|
||||
late double horizontralWindowPadding;
|
||||
late double vertticalWindowPadding;
|
||||
late double windowWidth;
|
||||
late double windowHeight;
|
||||
late double width;
|
||||
late double height;
|
||||
|
||||
void checkScreenSize() {
|
||||
// print("screen width: $width");
|
||||
// print("screen height: $height");
|
||||
if (MzanziInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||
setState(() {
|
||||
windowTitleSize = 25;
|
||||
horizontralWindowPadding = width / 7;
|
||||
vertticalWindowPadding = 25;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
windowTitleSize = 20;
|
||||
horizontralWindowPadding = 10;
|
||||
vertticalWindowPadding = 10;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Widget getWidnowClose() {
|
||||
return Container(
|
||||
alignment: Alignment.centerRight,
|
||||
child: IconButton(
|
||||
onPressed: widget.onWindowTapClose,
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getWidnowTools() {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: widget.windowTools,
|
||||
);
|
||||
}
|
||||
|
||||
Widget getWidnowTitle() {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.windowTitle,
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: windowTitleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget getWidnowHeader() {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
getWidnowTools(),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: getWidnowTitle(),
|
||||
),
|
||||
getWidnowClose(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget getWidnowBody() {
|
||||
if (widget.fullscreen) {
|
||||
return Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: widget.windowBody,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: widget.windowBody,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget createWindow(Widget header, Widget body) {
|
||||
Widget visibleItems;
|
||||
if (widget.fullscreen) {
|
||||
visibleItems = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
header,
|
||||
//const Divider(),
|
||||
body,
|
||||
],
|
||||
);
|
||||
} else {
|
||||
visibleItems = SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
header,
|
||||
//const Divider(),
|
||||
body,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
return Dialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: horizontralWindowPadding,
|
||||
vertical: vertticalWindowPadding,
|
||||
),
|
||||
insetAnimationCurve: Easing.emphasizedDecelerate,
|
||||
insetAnimationDuration: Durations.short1,
|
||||
child: Container(
|
||||
//padding: const EdgeInsets.all(10),
|
||||
width: windowWidth,
|
||||
//height: windowHeight,
|
||||
decoration: BoxDecoration(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
width: 5.0),
|
||||
),
|
||||
child: visibleItems,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var size = MediaQuery.of(context).size;
|
||||
setState(() {
|
||||
width = size.width;
|
||||
height = size.height;
|
||||
});
|
||||
checkScreenSize();
|
||||
return createWindow(
|
||||
getWidnowHeader(),
|
||||
getWidnowBody(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/Example/package_tools/package_tool_one.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/Example/package_tools/package_tool_two.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
@@ -18,8 +18,8 @@ class PackageTest extends StatefulWidget {
|
||||
class _PackageTestState extends State<PackageTest> {
|
||||
int _selcetedIndex = 0;
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -32,7 +32,7 @@ class _PackageTestState extends State<PackageTest> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = Map();
|
||||
temp[const Icon(Icons.inbox)] = () {
|
||||
setState(() {
|
||||
@@ -44,7 +44,7 @@ class _PackageTestState extends State<PackageTest> {
|
||||
_selcetedIndex = 1;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
@@ -54,7 +54,7 @@ class _PackageTestState extends State<PackageTest> {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MihAppAlert(
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
@@ -119,7 +119,7 @@ class _PackageTestState extends State<PackageTest> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
|
||||
@@ -4,8 +4,8 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_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_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
@@ -29,7 +29,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MihAppWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: true,
|
||||
windowTitle: "Test Full",
|
||||
onWindowTapClose: () {
|
||||
@@ -46,9 +46,29 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MihAppWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Test No Full",
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Show New Window",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
// showTestWindow();
|
||||
},
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -71,7 +91,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.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-app_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';
|
||||
|
||||
class PackageToolTwo extends StatefulWidget {
|
||||
@@ -14,7 +14,7 @@ class PackageToolTwo extends StatefulWidget {
|
||||
class _PackageToolTwoState extends State<PackageToolTwo> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
|
||||
class MihAppWindow extends StatefulWidget {
|
||||
final String windowTitle;
|
||||
final Widget windowBody;
|
||||
final Widget? windowTools;
|
||||
// final List<SpeedDialChild> menuOptions;
|
||||
final void Function() onWindowTapClose;
|
||||
final bool fullscreen;
|
||||
const MihAppWindow({
|
||||
super.key,
|
||||
required this.fullscreen,
|
||||
required this.windowTitle,
|
||||
this.windowTools,
|
||||
// required this.menuOptions,
|
||||
required this.onWindowTapClose,
|
||||
required this.windowBody,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihAppWindow> createState() => _MihAppWindowState();
|
||||
}
|
||||
|
||||
class _MihAppWindowState extends State<MihAppWindow> {
|
||||
late double windowTitleSize;
|
||||
late double horizontralWindowPadding;
|
||||
late double vertticalWindowPadding;
|
||||
late double windowWidth;
|
||||
late double windowHeight;
|
||||
late double width;
|
||||
late double height;
|
||||
|
||||
void checkScreenSize() {
|
||||
// print("screen width: $width");
|
||||
// print("screen height: $height");
|
||||
if (MzanziInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||
setState(() {
|
||||
windowTitleSize = 25;
|
||||
horizontralWindowPadding = width / 7;
|
||||
vertticalWindowPadding = 25;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
windowTitleSize = 20;
|
||||
horizontralWindowPadding = 10;
|
||||
vertticalWindowPadding = 10;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Widget getWindowHeader() {
|
||||
return Container(
|
||||
// color: Colors.green,
|
||||
alignment: Alignment.center,
|
||||
height: 50,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(25), // Optional: rounds the corners
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
60, 0, 0, 0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
spreadRadius: -5,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: IconButton.filled(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all<Color>(
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor()),
|
||||
),
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
iconSize: 20,
|
||||
onPressed: () {
|
||||
widget.onWindowTapClose();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
// color: Colors.pink,
|
||||
child: Text(
|
||||
widget.windowTitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: windowTitleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
widget.windowTools != null ? widget.windowTools! : Container(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var size = MediaQuery.of(context).size;
|
||||
setState(() {
|
||||
width = size.width;
|
||||
height = size.height;
|
||||
});
|
||||
checkScreenSize();
|
||||
return Dialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: horizontralWindowPadding,
|
||||
vertical: vertticalWindowPadding,
|
||||
),
|
||||
insetAnimationCurve: Easing.emphasizedDecelerate,
|
||||
insetAnimationDuration: Durations.short1,
|
||||
child: Container(
|
||||
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: widget.fullscreen
|
||||
? Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
getWindowHeader(),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(child: widget.windowBody)),
|
||||
],
|
||||
)
|
||||
: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
getWindowHeader(),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 25,
|
||||
right: 25,
|
||||
bottom: vertticalWindowPadding,
|
||||
),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: windowHeight * 0.85,
|
||||
maxWidth: windowWidth * 0.85,
|
||||
),
|
||||
child: MihSingleChildScroll(
|
||||
child: widget.windowBody))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,14 @@ import 'package:mzansi_innovation_hub/main.dart';
|
||||
|
||||
class MihFloatingMenu extends StatefulWidget {
|
||||
final IconData? icon;
|
||||
final double? iconSize;
|
||||
final AnimatedIconData? animatedIcon;
|
||||
final SpeedDialDirection? direction;
|
||||
final List<SpeedDialChild> children;
|
||||
const MihFloatingMenu({
|
||||
super.key,
|
||||
this.icon,
|
||||
this.iconSize,
|
||||
this.animatedIcon,
|
||||
this.direction,
|
||||
required this.children,
|
||||
@@ -22,26 +24,21 @@ class MihFloatingMenu extends StatefulWidget {
|
||||
class _MihFloatingMenuState extends State<MihFloatingMenu> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: SpeedDial(
|
||||
icon: widget.icon,
|
||||
animatedIcon: widget.animatedIcon,
|
||||
direction: widget.direction ?? SpeedDialDirection.up,
|
||||
activeIcon: Icons.close,
|
||||
backgroundColor: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
activeBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
foregroundColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
overlayColor: Colors.black,
|
||||
overlayOpacity: 0.5,
|
||||
children: widget.children,
|
||||
onOpen: () => debugPrint('OPENING DIAL'),
|
||||
onClose: () => debugPrint('DIAL CLOSED'),
|
||||
),
|
||||
return SpeedDial(
|
||||
icon: widget.icon,
|
||||
buttonSize: Size(widget.iconSize ?? 56.0, widget.iconSize ?? 56.0),
|
||||
animatedIcon: widget.animatedIcon,
|
||||
direction: widget.direction ?? SpeedDialDirection.up,
|
||||
activeIcon: Icons.close,
|
||||
backgroundColor: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
activeBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
foregroundColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
overlayColor: Colors.black,
|
||||
overlayOpacity: 0.5,
|
||||
children: widget.children,
|
||||
onOpen: () => debugPrint('OPENING DIAL'),
|
||||
onClose: () => debugPrint('DIAL CLOSED'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_app_drawer.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_swipe_detector/flutter_swipe_detector.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class MihApp extends StatefulWidget {
|
||||
class MihPackage extends StatefulWidget {
|
||||
final Widget appActionButton;
|
||||
final MihAppTools appTools;
|
||||
final MihPackageTools appTools;
|
||||
final List<Widget> appBody;
|
||||
final MIHAppDrawer? actionDrawer;
|
||||
int selectedbodyIndex;
|
||||
final Function(int) onIndexChange;
|
||||
MihApp({
|
||||
MihPackage({
|
||||
super.key,
|
||||
required this.appActionButton,
|
||||
required this.appTools,
|
||||
@@ -23,10 +23,11 @@ class MihApp extends StatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihApp> createState() => _MihAppState();
|
||||
State<MihPackage> createState() => _MihPackageState();
|
||||
}
|
||||
|
||||
class _MihAppState extends State<MihApp> with SingleTickerProviderStateMixin {
|
||||
class _MihPackageState extends State<MihPackage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late PageController _pageController;
|
||||
late AnimationController _animationController;
|
||||
|
||||
@@ -65,7 +66,7 @@ class _MihAppState extends State<MihApp> with SingleTickerProviderStateMixin {
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant MihApp oldWidget) {
|
||||
void didUpdateWidget(covariant MihPackage oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (oldWidget.selectedbodyIndex != widget.selectedbodyIndex) {
|
||||
_pageController.animateToPage(
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihAppAction extends StatefulWidget {
|
||||
class MihPackageAction extends StatefulWidget {
|
||||
final void Function()? onTap;
|
||||
final double iconSize;
|
||||
final Widget icon;
|
||||
const MihAppAction({
|
||||
const MihPackageAction({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.iconSize,
|
||||
@@ -12,10 +12,10 @@ class MihAppAction extends StatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihAppAction> createState() => _MihAppActionState();
|
||||
State<MihPackageAction> createState() => _MihPackageActionState();
|
||||
}
|
||||
|
||||
class _MihAppActionState extends State<MihAppAction> {
|
||||
class _MihPackageActionState extends State<MihPackageAction> {
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihAppAlert extends StatefulWidget {
|
||||
class MihPackageAlert extends StatefulWidget {
|
||||
final Widget alertIcon;
|
||||
final String alertTitle;
|
||||
final Widget alertBody;
|
||||
final Color alertColour;
|
||||
const MihAppAlert({
|
||||
const MihPackageAlert({
|
||||
super.key,
|
||||
required this.alertIcon,
|
||||
required this.alertTitle,
|
||||
@@ -15,10 +15,10 @@ class MihAppAlert extends StatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihAppAlert> createState() => _MihAppAlertState();
|
||||
State<MihPackageAlert> createState() => _MihPackageAlertState();
|
||||
}
|
||||
|
||||
class _MihAppAlertState extends State<MihAppAlert> {
|
||||
class _MihPackageAlertState extends State<MihPackageAlert> {
|
||||
late double popUpWidth;
|
||||
late double? popUpheight;
|
||||
late double popUpTitleSize;
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_yt_video_player.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihAppTile extends StatefulWidget {
|
||||
class MihPackageTile extends StatefulWidget {
|
||||
final String appName;
|
||||
final String? ytVideoID;
|
||||
final Widget appIcon;
|
||||
@@ -11,7 +11,7 @@ class MihAppTile extends StatefulWidget {
|
||||
final double iconSize;
|
||||
final Color primaryColor;
|
||||
final Color secondaryColor;
|
||||
const MihAppTile({
|
||||
const MihPackageTile({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
required this.appName,
|
||||
@@ -23,16 +23,16 @@ class MihAppTile extends StatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihAppTile> createState() => _MihAppTileState();
|
||||
State<MihPackageTile> createState() => _MihPackageTileState();
|
||||
}
|
||||
|
||||
class _MihAppTileState extends State<MihAppTile> {
|
||||
class _MihPackageTileState extends State<MihPackageTile> {
|
||||
void displayHint() {
|
||||
if (widget.ytVideoID != null) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MihAppWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: widget.appName,
|
||||
// windowTools: const [],
|
||||
@@ -1,20 +1,20 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihAppToolBody extends StatefulWidget {
|
||||
class MihPackageToolBody extends StatefulWidget {
|
||||
final bool borderOn;
|
||||
final Widget bodyItem;
|
||||
const MihAppToolBody({
|
||||
const MihPackageToolBody({
|
||||
super.key,
|
||||
required this.borderOn,
|
||||
required this.bodyItem,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihAppToolBody> createState() => _MihAppToolBodyState();
|
||||
State<MihPackageToolBody> createState() => _MihPackageToolBodyState();
|
||||
}
|
||||
|
||||
class _MihAppToolBodyState extends State<MihAppToolBody> {
|
||||
class _MihPackageToolBodyState extends State<MihPackageToolBody> {
|
||||
late double _innerBodyPadding;
|
||||
double getHorizontalPaddingSize(Size screenSize) {
|
||||
if (MzanziInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||
@@ -1,20 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class MihAppTools extends StatefulWidget {
|
||||
class MihPackageTools extends StatefulWidget {
|
||||
final Map<Widget, void Function()?> tools;
|
||||
int selcetedIndex;
|
||||
MihAppTools({
|
||||
MihPackageTools({
|
||||
super.key,
|
||||
required this.tools,
|
||||
required this.selcetedIndex,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihAppTools> createState() => _MihAppToolsState();
|
||||
State<MihPackageTools> createState() => _MihPackageToolsState();
|
||||
}
|
||||
|
||||
class _MihAppToolsState extends State<MihAppTools> {
|
||||
class _MihPackageToolsState extends State<MihPackageTools> {
|
||||
List<Widget> getTools() {
|
||||
List<Widget> temp = [];
|
||||
int index = 0;
|
||||
@@ -0,0 +1,210 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.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_floating_menu.dart';
|
||||
|
||||
class MihPackageWindow extends StatefulWidget {
|
||||
final String windowTitle;
|
||||
final Widget windowBody;
|
||||
final List<SpeedDialChild>? menuOptions;
|
||||
final void Function() onWindowTapClose;
|
||||
final bool fullscreen;
|
||||
const MihPackageWindow({
|
||||
super.key,
|
||||
required this.fullscreen,
|
||||
required this.windowTitle,
|
||||
this.menuOptions,
|
||||
required this.onWindowTapClose,
|
||||
required this.windowBody,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihPackageWindow> createState() => _MihPackageWindowState();
|
||||
}
|
||||
|
||||
class _MihPackageWindowState extends State<MihPackageWindow> {
|
||||
late double windowTitleSize;
|
||||
late double horizontralWindowPadding;
|
||||
late double vertticalWindowPadding;
|
||||
late double windowWidth;
|
||||
late double windowHeight;
|
||||
late double width;
|
||||
late double height;
|
||||
|
||||
void checkScreenSize() {
|
||||
// print("screen width: $width");
|
||||
// print("screen height: $height");
|
||||
if (MzanziInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||
setState(() {
|
||||
windowTitleSize = 25;
|
||||
horizontralWindowPadding = width / 7;
|
||||
vertticalWindowPadding = 25;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
windowTitleSize = 20;
|
||||
horizontralWindowPadding = 10;
|
||||
vertticalWindowPadding = 10;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Widget getHeader() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(25), // Optional: rounds the corners
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
60, 0, 0, 0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
spreadRadius: -2,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 2.0,
|
||||
left: 5.0,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 40,
|
||||
child: IconButton.filled(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all<Color>(
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor()),
|
||||
),
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
iconSize: 20,
|
||||
onPressed: () {
|
||||
widget.onWindowTapClose();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
widget.windowTitle,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: windowTitleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: (widget.menuOptions?.isNotEmpty ?? false),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 2.0,
|
||||
right: 5.0,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 40,
|
||||
child: MihFloatingMenu(
|
||||
iconSize: 40,
|
||||
animatedIcon: AnimatedIcons.menu_close,
|
||||
direction: SpeedDialDirection.down,
|
||||
children: widget.menuOptions != null ? widget.menuOptions! : [],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// If no menu, add a SizedBox to keep alignment
|
||||
if (!(widget.menuOptions?.isNotEmpty ?? false))
|
||||
const SizedBox(width: 40),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var size = MediaQuery.of(context).size;
|
||||
setState(() {
|
||||
width = size.width;
|
||||
height = size.height;
|
||||
});
|
||||
checkScreenSize();
|
||||
return Dialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: horizontralWindowPadding,
|
||||
vertical: vertticalWindowPadding,
|
||||
),
|
||||
insetAnimationCurve: Easing.emphasizedDecelerate,
|
||||
insetAnimationDuration: Durations.short1,
|
||||
child: Container(
|
||||
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: widget.fullscreen
|
||||
? Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
getHeader(),
|
||||
const SizedBox(height: 5),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(child: widget.windowBody)),
|
||||
],
|
||||
)
|
||||
: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
getHeader(),
|
||||
const SizedBox(height: 5),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 25,
|
||||
right: 25,
|
||||
bottom: vertticalWindowPadding,
|
||||
),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: windowHeight * 0.85,
|
||||
maxWidth: windowWidth * 0.85,
|
||||
),
|
||||
child: MihSingleChildScroll(child: widget.windowBody),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_%20attributes.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_info.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_privacy_policy.dart';
|
||||
@@ -31,7 +31,7 @@ class _AboutMihState extends State<AboutMih> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -45,8 +45,8 @@ class _AboutMihState extends State<AboutMih> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -56,7 +56,7 @@ class _AboutMihState extends State<AboutMih> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.info)] = () {
|
||||
setState(() {
|
||||
@@ -78,7 +78,7 @@ class _AboutMihState extends State<AboutMih> {
|
||||
_selcetedIndex = 3;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
|
||||
@@ -17,7 +17,7 @@ class AboutMihTile extends StatefulWidget {
|
||||
class _AboutMihTileState extends State<AboutMihTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/about',
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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:url_launcher/url_launcher.dart';
|
||||
|
||||
@@ -83,7 +83,7 @@ class _MihAttributesState extends State<MihAttributes> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -87,7 +87,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
// context: context,
|
||||
// barrierDismissible: false,
|
||||
// builder: (context) {
|
||||
// return MihAppWindow(
|
||||
// return MihPackageWindow(
|
||||
// fullscreen: false,
|
||||
// windowTitle: "MIH Installation Guide (iOS)",
|
||||
// windowTools: const [],
|
||||
@@ -634,7 +634,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -8,7 +8,7 @@ class MihPrivacyPolicy extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(context),
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -8,7 +8,7 @@ class MIHTermsOfService extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(context),
|
||||
);
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/access_request.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
import '../../../main.dart';
|
||||
import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import '../../../mih_components/mih_layout/mih_window.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_warning_message.dart';
|
||||
import '../../../mih_env/env.dart';
|
||||
import '../../../mih_objects/access_request.dart';
|
||||
import '../../../mih_objects/app_user.dart';
|
||||
|
||||
class BuildAccessRequestList extends StatefulWidget {
|
||||
final List<AccessRequest> accessRequests;
|
||||
final AppUser signedInUser;
|
||||
@@ -220,65 +219,66 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Update Appointment Access",
|
||||
windowBody: [
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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(),
|
||||
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(),
|
||||
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(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
windowTools: const [],
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../main.dart';
|
||||
import '../../../mih_apis/mih_api_calls.dart';
|
||||
import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import '../../../mih_components/mih_layout/mih_window.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_warning_message.dart';
|
||||
import '../../../mih_env/env.dart';
|
||||
import '../../../mih_objects/app_user.dart';
|
||||
import '../../../mih_objects/patient_access.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_api_calls.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/patient_access.dart';
|
||||
|
||||
class BuildBusinessAccessList extends StatefulWidget {
|
||||
final List<PatientAccess> patientAccessList;
|
||||
@@ -216,217 +215,227 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Profile Access",
|
||||
windowBody: [
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: 1000,
|
||||
child: Text(
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: 1000,
|
||||
child: Text(
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'pending',
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Important Notice: Approving Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
const SizedBox(height: 20.0),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'pending',
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Important Notice: Approving Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"You are about to accept access to your patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"1. Permanent Access: Once you accepts this access request, it will become permanent.",
|
||||
Text(
|
||||
"You are about to accept access to your patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"1. Permanent Access: Once you accepts this access request, it will become permanent.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"By pressing the \"Approve\" button you accept the above terms.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"By pressing the \"Approve\" button you accept the above terms.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'approved',
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Important Notice: Approved Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'approved',
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Important Notice: Approved Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"You have accepted access to your patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"1. Permanent Access: This access is permanent.",
|
||||
Text(
|
||||
"You have accepted access to your patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"1. Permanent Access: This access is permanent.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"3. Irreversible Access: You cannot revoke this access to your patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: Text(
|
||||
"3. Irreversible Access: You cannot revoke this access to your patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'pending',
|
||||
child: Wrap(
|
||||
runSpacing: 10,
|
||||
spacing: 10,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: popUpButtonWidth,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
print("request declined");
|
||||
MIHApiCalls.updatePatientAccessAPICall(
|
||||
widget.patientAccessList[index].business_id,
|
||||
widget.patientAccessList[index].requested_by,
|
||||
widget.patientAccessList[index].app_id,
|
||||
"declined",
|
||||
"${widget.signedInUser.fname} ${widget.signedInUser.lname}",
|
||||
widget.signedInUser,
|
||||
context,
|
||||
);
|
||||
//updateAccessAPICall(index, "declined");
|
||||
},
|
||||
buttonText: "Decline",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: popUpButtonWidth,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
print("request approved");
|
||||
MIHApiCalls.updatePatientAccessAPICall(
|
||||
widget.patientAccessList[index].business_id,
|
||||
widget.patientAccessList[index].requested_by,
|
||||
widget.patientAccessList[index].app_id,
|
||||
"approved",
|
||||
"${widget.signedInUser.fname} ${widget.signedInUser.lname}",
|
||||
widget.signedInUser,
|
||||
context,
|
||||
);
|
||||
//updateAccessAPICall(index, "approved");
|
||||
},
|
||||
buttonText: "Approve",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 20.0),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
windowTools: const [],
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'pending',
|
||||
child: Wrap(
|
||||
runSpacing: 10,
|
||||
spacing: 10,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: popUpButtonWidth,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
print("request declined");
|
||||
MIHApiCalls.updatePatientAccessAPICall(
|
||||
widget.patientAccessList[index].business_id,
|
||||
widget.patientAccessList[index].requested_by,
|
||||
widget.patientAccessList[index].app_id,
|
||||
"declined",
|
||||
"${widget.signedInUser.fname} ${widget.signedInUser.lname}",
|
||||
widget.signedInUser,
|
||||
context,
|
||||
);
|
||||
//updateAccessAPICall(index, "declined");
|
||||
},
|
||||
buttonText: "Decline",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: popUpButtonWidth,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
print("request approved");
|
||||
MIHApiCalls.updatePatientAccessAPICall(
|
||||
widget.patientAccessList[index].business_id,
|
||||
widget.patientAccessList[index].requested_by,
|
||||
widget.patientAccessList[index].app_id,
|
||||
"approved",
|
||||
"${widget.signedInUser.fname} ${widget.signedInUser.lname}",
|
||||
widget.signedInUser,
|
||||
context,
|
||||
);
|
||||
//updateAccessAPICall(index, "approved");
|
||||
},
|
||||
buttonText: "Approve",
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.successColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/package_tools/mih_access_requests.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -20,7 +20,7 @@ class _MihAccessState extends State<MihAccess> {
|
||||
int _selcetedIndex = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -34,8 +34,8 @@ class _MihAccessState extends State<MihAccess> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -45,14 +45,14 @@ class _MihAccessState extends State<MihAccess> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.people)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,7 +21,7 @@ class MihAccessTile extends StatefulWidget {
|
||||
class _MihAccessTileState extends State<MihAccessTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mih-access',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../main.dart';
|
||||
@@ -244,7 +244,7 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart'
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_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_packages/mih_home/mih_profile_getter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -106,7 +106,7 @@ class _BiometricCheckState extends State<BiometricCheck> {
|
||||
}
|
||||
|
||||
void authErrorPopUp() {
|
||||
Widget alertpopUp = MihAppAlert(
|
||||
Widget alertpopUp = MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.fingerprint,
|
||||
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tools/simple_calc.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tools/tip_calc.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,7 +21,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -35,8 +35,8 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -46,7 +46,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.calculate)] = () {
|
||||
setState(() {
|
||||
@@ -58,7 +58,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
_selectedIndex = 1;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selectedIndex,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
|
||||
@@ -20,7 +20,7 @@ class MihCalculatorTile extends StatefulWidget {
|
||||
class _MihCalculatorTileState extends State<MihCalculatorTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/calculator',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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:math_expressions/math_expressions.dart';
|
||||
|
||||
@@ -71,7 +71,7 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -3,8 +3,8 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -116,107 +116,27 @@ class _TipCalcState extends State<TipCalc> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Calculation Results",
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowTools: const [],
|
||||
windowBody: [
|
||||
// FaIcon(
|
||||
// FontAwesomeIcons.moneyBills,
|
||||
// color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
// size: 30,
|
||||
// ),
|
||||
// const Divider(),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.coins,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
"Tip",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
tip,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.moneyBills,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
"Total",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
total,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"~ ${double.parse(total).ceil()}.00",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
if (splitBillController.text == "Yes")
|
||||
windowBody: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.peopleGroup,
|
||||
FontAwesomeIcons.coins,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
"Total per Person",
|
||||
"Tip",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
@@ -227,9 +147,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
),
|
||||
],
|
||||
),
|
||||
if (splitBillController.text == "Yes")
|
||||
Text(
|
||||
amountPerPerson,
|
||||
tip,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
@@ -237,9 +156,32 @@ class _TipCalcState extends State<TipCalc> {
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
if (splitBillController.text == "Yes")
|
||||
const Divider(),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.moneyBills,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
"Total",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
"~ ${double.parse(amountPerPerson).ceil()}.00",
|
||||
total,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
@@ -247,8 +189,66 @@ class _TipCalcState extends State<TipCalc> {
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
// if (splitBillController.text == "Yes") const Divider(),
|
||||
],
|
||||
Text(
|
||||
"~ ${double.parse(total).ceil()}.00",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
if (splitBillController.text == "Yes")
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.peopleGroup,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
"Total per Person",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (splitBillController.text == "Yes")
|
||||
Text(
|
||||
amountPerPerson,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
if (splitBillController.text == "Yes")
|
||||
Text(
|
||||
"~ ${double.parse(amountPerPerson).ceil()}.00",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
// if (splitBillController.text == "Yes") const Divider(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
import '../../../main.dart';
|
||||
import '../../../mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import '../../../mih_components/mih_layout/mih_window.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
import '../../../mih_components/mih_pop_up_messages/mih_warning_message.dart';
|
||||
@@ -221,180 +221,70 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Update Appointment Access",
|
||||
windowBody: [
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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(),
|
||||
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(),
|
||||
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(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
windowTools: const [],
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
onWindowTapClose: () {
|
||||
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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_calendar_apis.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
@@ -5,7 +6,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_multiline_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_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_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
@@ -151,18 +152,45 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Appointment Details",
|
||||
windowTools: [
|
||||
Visibility(
|
||||
visible: canEditAppointment(index),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
deleteAppointmentConfirmationWindow(index);
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Edit Appointment",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
appointmentUpdateWindow(index);
|
||||
},
|
||||
),
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Appointment",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
deleteAppointmentConfirmationWindow(index);
|
||||
},
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
@@ -172,79 +200,50 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
widget.titleController.clear();
|
||||
widget.descriptionIDController.clear();
|
||||
},
|
||||
windowBody: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.titleController,
|
||||
hintText: "Title",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.dateController,
|
||||
hintText: "Date",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.timeController,
|
||||
hintText: "Time",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: widget.descriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Visibility(
|
||||
visible: canEditAppointment(index),
|
||||
child: SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
appointmentUpdateWindow(index);
|
||||
},
|
||||
buttonText: "Edit",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
controller: widget.titleController,
|
||||
hintText: "Title",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// width: 500,
|
||||
// height: 50,
|
||||
// child: MIHButton(
|
||||
// onTap: () {
|
||||
// addAppointmentCall();
|
||||
// checkforchange();
|
||||
// },
|
||||
// buttonText: "Add",
|
||||
// buttonColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
// textColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.dateController,
|
||||
hintText: "Date",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.timeController,
|
||||
hintText: "Time",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: widget.descriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -255,18 +254,45 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Appointment Details",
|
||||
windowTools: [
|
||||
Visibility(
|
||||
visible: canEditAppointment(index),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
deleteAppointmentConfirmationWindow(index);
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Edit Appointment",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
appointmentUpdateWindow(index);
|
||||
},
|
||||
),
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Appointment",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
deleteAppointmentConfirmationWindow(index);
|
||||
},
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
@@ -276,89 +302,59 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
widget.titleController.clear();
|
||||
widget.descriptionIDController.clear();
|
||||
},
|
||||
windowBody: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.titleController,
|
||||
hintText: "Title",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.titleController,
|
||||
hintText: "Patient ID Number",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
windowBody: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.dateController,
|
||||
hintText: "Date",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.timeController,
|
||||
hintText: "Time",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: widget.descriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Visibility(
|
||||
visible: canEditAppointment(index),
|
||||
child: SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
appointmentUpdateWindow(index);
|
||||
},
|
||||
buttonText: "Edit",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
controller: widget.titleController,
|
||||
hintText: "Title",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// width: 500,
|
||||
// height: 50,
|
||||
// child: MIHButton(
|
||||
// onTap: () {
|
||||
// addAppointmentCall();
|
||||
// checkforchange();
|
||||
// },
|
||||
// buttonText: "Add",
|
||||
// buttonColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
// textColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.titleController,
|
||||
hintText: "Patient ID Number",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.dateController,
|
||||
hintText: "Date",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.timeController,
|
||||
hintText: "Time",
|
||||
editable: false,
|
||||
required: false,
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: widget.descriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -369,10 +365,9 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Update Appointment",
|
||||
windowTools: [],
|
||||
onWindowTapClose: () {
|
||||
setState(() {
|
||||
widget.titleController.text = widget.appointmentList[index].title;
|
||||
@@ -387,95 +382,70 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
windowBody: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.titleController,
|
||||
hintText: "Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHDateField(
|
||||
controller: widget.dateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTimeField(
|
||||
controller: widget.timeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: widget.descriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
runSpacing: 10,
|
||||
spacing: 10,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
updateAppointmentCall(index);
|
||||
},
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: widget.titleController,
|
||||
hintText: "Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
// SizedBox(
|
||||
// width: 500,
|
||||
// height: 50,
|
||||
// child: MIHButton(
|
||||
// onTap: () {
|
||||
// setState(() {
|
||||
// widget.titleController.text =
|
||||
// widget.appointmentList[index].title;
|
||||
// widget.descriptionIDController.text =
|
||||
// widget.appointmentList[index].description;
|
||||
// widget.dateController.text = widget
|
||||
// .appointmentList[index].date_time
|
||||
// .split('T')[0];
|
||||
// widget.timeController.text = widget
|
||||
// .appointmentList[index].date_time
|
||||
// .split('T')[1]
|
||||
// .substring(0, 5);
|
||||
// });
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// buttonText: "Cancel",
|
||||
// buttonColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
// textColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHDateField(
|
||||
controller: widget.dateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTimeField(
|
||||
controller: widget.timeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: widget.descriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
runSpacing: 10,
|
||||
spacing: 10,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
updateAppointmentCall(index);
|
||||
},
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calendar/package_tools/appointments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,7 +21,7 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -35,8 +35,8 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -46,7 +46,7 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.calendar_month)] = () {
|
||||
setState(() {
|
||||
@@ -54,7 +54,7 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
});
|
||||
};
|
||||
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,7 +21,7 @@ class MzansiCalendarTile extends StatefulWidget {
|
||||
class _MzansiCalendarTileState extends State<MzansiCalendarTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/calendar',
|
||||
|
||||
@@ -6,9 +6,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/appointment.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
@@ -101,10 +101,9 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Add Appointment",
|
||||
windowTools: [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.of(context).pop();
|
||||
_appointmentDateController.clear();
|
||||
@@ -112,61 +111,63 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
_appointmentTitleController.clear();
|
||||
_appointmentDescriptionIDController.clear();
|
||||
},
|
||||
windowBody: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: _appointmentTitleController,
|
||||
hintText: "Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
windowBody: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: _appointmentTitleController,
|
||||
hintText: "Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHDateField(
|
||||
controller: _appointmentDateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHDateField(
|
||||
controller: _appointmentDateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTimeField(
|
||||
controller: _appointmentTimeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTimeField(
|
||||
controller: _appointmentTimeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: _appointmentDescriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: true,
|
||||
required: true,
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: _appointmentDescriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
addAppointmentCall();
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
addAppointmentCall();
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -365,7 +366,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
@@ -74,7 +74,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -98,7 +98,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
|
||||
Widget getAction() {
|
||||
return Builder(builder: (context) {
|
||||
return MihAppAction(
|
||||
return MihPackageAction(
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.only(left: 5.0),
|
||||
child: MihCircleAvatar(
|
||||
@@ -140,7 +140,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.person)] = () {
|
||||
setState(() {
|
||||
@@ -156,7 +156,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
});
|
||||
};
|
||||
}
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -2,6 +2,8 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
// import 'dart:convert';
|
||||
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/patients.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -21,7 +23,6 @@ import '../../mih_components/mih_layout/mih_header.dart';
|
||||
import '../../mih_components/mih_layout/mih_layout_builder.dart';
|
||||
import '../../mih_components/mih_layout/mih_notification_drawer.dart';
|
||||
import '../../mih_components/mih_layout/mih_tile.dart';
|
||||
import '../../mih_components/mih_layout/mih_window.dart';
|
||||
import '../../mih_components/mih_pop_up_messages/mih_delete_message.dart';
|
||||
import '../../mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import '../../mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
@@ -844,39 +845,35 @@ class _MIHHomeLegacyState extends State<MIHHomeLegacy> {
|
||||
// return const MIHErrorMessage(errorType: "User Exists");
|
||||
// return const MIHErrorMessage(errorType: "Password Match");
|
||||
// return const MIHErrorMessage(errorType: "Invalid Credentials");
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle:
|
||||
"Test Window title that is too large for mobile devices",
|
||||
windowBody: const [
|
||||
SizedBox(
|
||||
height: 250,
|
||||
)
|
||||
],
|
||||
windowTools: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
//deleteFilePopUp(filePath, fileID);
|
||||
},
|
||||
icon: Icon(
|
||||
windowBody: const Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 250,
|
||||
)
|
||||
],
|
||||
),
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
size: 35,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
//deleteFilePopUp(filePath, fileID);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.wallet,
|
||||
size: 35,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
label: "Delete File",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/mih_home.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -67,7 +67,7 @@ class _MIHProfileGetterState extends State<MIHProfileGetter> {
|
||||
}
|
||||
}
|
||||
|
||||
MihAppTools getErrorTools() {
|
||||
MihPackageTools getErrorTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.power_off_outlined)] = () {
|
||||
setState(() {
|
||||
@@ -75,7 +75,7 @@ class _MIHProfileGetterState extends State<MIHProfileGetter> {
|
||||
});
|
||||
};
|
||||
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
@@ -83,7 +83,7 @@ class _MIHProfileGetterState extends State<MIHProfileGetter> {
|
||||
|
||||
List<Widget> getErrorToolBody(String error) {
|
||||
List<Widget> toolBodies = [
|
||||
MihAppToolBody(
|
||||
MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -152,8 +152,8 @@ class _MIHProfileGetterState extends State<MIHProfileGetter> {
|
||||
}
|
||||
|
||||
Widget errorPage(String error) {
|
||||
return MihApp(
|
||||
appActionButton: MihAppAction(
|
||||
return MihPackage(
|
||||
appActionButton: MihPackageAction(
|
||||
icon: const Icon(Icons.refresh),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
@@ -189,7 +189,7 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
final Size size = MediaQuery.sizeOf(context);
|
||||
final double width = size.width;
|
||||
final double height = size.height;
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width, height),
|
||||
);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.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_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
@@ -149,7 +149,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
//=============== Dev ===============
|
||||
if (widget.isDevActive) {
|
||||
temp.add({
|
||||
"test": MihAppTile(
|
||||
"test": MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/package-dev',
|
||||
@@ -234,7 +234,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
final double width = size.width;
|
||||
final double height = size.height;
|
||||
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width, height),
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_ai/package_tools/ai_chat.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -19,8 +19,8 @@ class MzansiAi extends StatefulWidget {
|
||||
class _MzansiAiState extends State<MzansiAi> {
|
||||
int _selcetedIndex = 0;
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -30,7 +30,7 @@ class _MzansiAiState extends State<MzansiAi> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.chat)] = () {
|
||||
setState(() {
|
||||
@@ -38,7 +38,7 @@ class _MzansiAiState extends State<MzansiAi> {
|
||||
});
|
||||
};
|
||||
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
@@ -58,7 +58,7 @@ class _MzansiAiState extends State<MzansiAi> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,7 +21,7 @@ class MzansiAiTile extends StatefulWidget {
|
||||
class _MzansiAiTileState extends State<MzansiAiTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-ai',
|
||||
|
||||
@@ -5,8 +5,8 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
@@ -169,67 +169,35 @@ class _AiChatState extends State<AiChat> {
|
||||
textStream = snapshot.requireData;
|
||||
// print("Text: $textStream");
|
||||
// _speakText(textStream!);
|
||||
return MihAppWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: 'Mzansi AI Thoughts',
|
||||
windowTools: Row(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: _aiThinking == false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Container(
|
||||
//color: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
decoration: BoxDecoration(
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.successColor(),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(100),
|
||||
),
|
||||
),
|
||||
child: IconButton(
|
||||
menuOptions: _aiThinking == true
|
||||
? null
|
||||
: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.volume_up,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
onPressed: () async {
|
||||
print("Start TTS now");
|
||||
|
||||
_speakText(snapshot.requireData);
|
||||
},
|
||||
icon: const Icon(Icons.volume_up),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: _aiThinking == true,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Container(
|
||||
// color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(100),
|
||||
),
|
||||
),
|
||||
child: IconButton(
|
||||
label: "Read Aloud",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
onPressed: () {
|
||||
//print("Start TTS now");
|
||||
_flutterTts.stop();
|
||||
},
|
||||
icon: const Icon(Icons.volume_off),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
_speakText(snapshot.requireData);
|
||||
},
|
||||
)
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
_captureAIResponse(snapshot.requireData);
|
||||
_flutterTts.stop();
|
||||
@@ -241,66 +209,23 @@ class _AiChatState extends State<AiChat> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
Text(
|
||||
snapshot.requireData,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
fontSize: _chatFrontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: Visibility(
|
||||
visible: _aiThinking == false,
|
||||
child: IconButton.filled(
|
||||
iconSize: 25,
|
||||
autofocus: true,
|
||||
onPressed: () {
|
||||
_captureAIResponse(snapshot.requireData);
|
||||
_flutterTts.stop();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
focusColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.successColor(),
|
||||
icon: Icon(
|
||||
Icons.check,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
),
|
||||
|
||||
// MIHButton(
|
||||
// onTap: () {
|
||||
// _captureAIResponse(snapshot.requireData);
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// buttonText: "Continue",
|
||||
// buttonColor: MzanziInnovationHub.of(context)!
|
||||
// .theme
|
||||
// .successColor(),
|
||||
// textColor: MzanziInnovationHub.of(context)!
|
||||
// .theme
|
||||
// .primaryColor(),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
],
|
||||
Text(
|
||||
snapshot.requireData,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
fontSize: _chatFrontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return MihAppWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: 'Mzansi AI Thoughts',
|
||||
// windowTools: [],
|
||||
@@ -672,7 +597,7 @@ class _AiChatState extends State<AiChat> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_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_loading_circle.dart';
|
||||
@@ -149,80 +150,92 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Employee Details",
|
||||
windowTools: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Employee",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
showDeleteWarning(index);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
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,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
updateEmployeeAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: typeController,
|
||||
hintText: "Title",
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
updateEmployeeAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_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_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
@@ -124,70 +124,71 @@ class _BuildUserListState extends State<BuildUserList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Add Employee",
|
||||
windowBody: [
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "Username Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Email",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: typeController,
|
||||
hintText: "Title",
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
createBusinessUserAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(
|
||||
errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "Username Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
],
|
||||
windowTools: [],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Email",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: typeController,
|
||||
hintText: "Title",
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
createBusinessUserAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(
|
||||
errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
],
|
||||
),
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
}));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/package_tools/mih_business_details.dart';
|
||||
@@ -46,7 +46,7 @@ class _MzansiBusinessProfileState extends State<MzansiBusinessProfile> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -59,8 +59,8 @@ class _MzansiBusinessProfileState extends State<MzansiBusinessProfile> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -70,7 +70,7 @@ class _MzansiBusinessProfileState extends State<MzansiBusinessProfile> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.business)] = () {
|
||||
setState(() {
|
||||
@@ -97,7 +97,7 @@ class _MzansiBusinessProfileState extends State<MzansiBusinessProfile> {
|
||||
_selcetedIndex = 3;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,7 +21,7 @@ class MzansiBusinessProfileTile extends StatefulWidget {
|
||||
class _MzansiBusinessProfileTileState extends State<MzansiBusinessProfileTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/business-profile/manage',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -22,7 +22,7 @@ class _MzansiSetupBusinessProfileTileState
|
||||
extends State<MzansiSetupBusinessProfileTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/business-profile/set-up',
|
||||
|
||||
@@ -7,8 +7,8 @@ import 'package:mzansi_innovation_hub/mih_apis/mih_location_api.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart';
|
||||
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';
|
||||
@@ -91,7 +91,7 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MihAppAlert(
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.warning_rounded,
|
||||
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
@@ -233,7 +233,7 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(context),
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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-app_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_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';
|
||||
@@ -322,7 +322,7 @@ class _MihBusinessProfileState extends State<MihBusinessProfile> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:convert';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_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-app_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_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_env/env.dart';
|
||||
@@ -91,7 +91,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:mzansi_innovation_hub/main.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-app_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_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
@@ -74,7 +74,7 @@ class _MihMyBusinessTeamState extends State<MihMyBusinessTeam> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -7,8 +7,8 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_image_display.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
@@ -126,7 +126,7 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MihAppAlert(
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.warning_rounded,
|
||||
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
@@ -205,7 +205,7 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
import '../../../../main.dart';
|
||||
import '../../../../mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import '../../../../mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import '../../../../mih_components/mih_layout/mih_window.dart';
|
||||
import '../../../../mih_components/mih_pop_up_messages/mih_delete_message.dart';
|
||||
import '../../../../mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import '../../../../mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
@@ -150,80 +151,92 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Employee Details",
|
||||
windowTools: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Employee",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
showDeleteWarning(index);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
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,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
updateEmployeeAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: typeController,
|
||||
hintText: "Title",
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
updateEmployeeAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
// showDialog(
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
import '../../../../main.dart';
|
||||
import '../../../../mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import '../../../../mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import '../../../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import '../../../../mih_components/mih_layout/mih_window.dart';
|
||||
import '../../../../mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import '../../../../mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import '../../../../mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
@@ -125,188 +125,74 @@ class _BuildUserListState extends State<BuildUserList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Add Employee",
|
||||
windowBody: [
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "Username Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Email",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: typeController,
|
||||
hintText: "Title",
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
createBusinessUserAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(
|
||||
errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "Username Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
],
|
||||
windowTools: [],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Email",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: typeController,
|
||||
hintText: "Title",
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: accessController,
|
||||
hintText: "Access",
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isRequiredFieldsCaptured()) {
|
||||
createBusinessUserAPICall(index);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(
|
||||
errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
],
|
||||
),
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
}));
|
||||
// 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(
|
||||
// "Add Employee",
|
||||
// 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: "Username Name",
|
||||
// editable: false,
|
||||
// required: true,
|
||||
// ),
|
||||
// const SizedBox(height: 10.0),
|
||||
// MIHTextField(
|
||||
// controller: lnameController,
|
||||
// hintText: "Email",
|
||||
// editable: false,
|
||||
// required: true,
|
||||
// ),
|
||||
// const SizedBox(height: 10.0),
|
||||
// MIHDropdownField(
|
||||
// controller: typeController,
|
||||
// hintText: "Title",
|
||||
// dropdownOptions: const ["Doctor", "Assistant"],
|
||||
// required: true,
|
||||
// editable: true,
|
||||
// ),
|
||||
// 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: "Add",
|
||||
// buttonColor: MzanziInnovationHub.of(context)!
|
||||
// .theme
|
||||
// .secondaryColor(),
|
||||
// textColor: MzanziInnovationHub.of(context)!
|
||||
// .theme
|
||||
// .primaryColor(),
|
||||
// onTap: () {
|
||||
// if (isRequiredFieldsCaptured()) {
|
||||
// createBusinessUserAPICall(index);
|
||||
// } else {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return const MIHErrorMessage(
|
||||
// errorType: "Input Error");
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/personal_profile/package_tools/mih_personal_settings.dart';
|
||||
@@ -22,7 +22,7 @@ class _MzansiProfileState extends State<MzansiProfile> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -35,8 +35,8 @@ class _MzansiProfileState extends State<MzansiProfile> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -46,7 +46,7 @@ class _MzansiProfileState extends State<MzansiProfile> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.perm_identity)] = () {
|
||||
setState(() {
|
||||
@@ -58,7 +58,7 @@ class _MzansiProfileState extends State<MzansiProfile> {
|
||||
_selcetedIndex = 1;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
@@ -25,7 +25,7 @@ class _MzansiProfileTileState extends State<MzansiProfileTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// ImageProvider logo = MzanziInnovationHub.of(context)!.theme.logoImage();
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-profile',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
@@ -24,7 +24,7 @@ class MzansiSetupProfileTile extends StatefulWidget {
|
||||
class _MzansiSetupProfileTileState extends State<MzansiSetupProfileTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-profile',
|
||||
|
||||
@@ -7,8 +7,8 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart';
|
||||
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';
|
||||
@@ -44,7 +44,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MihAppAlert(
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
@@ -252,7 +252,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -2,8 +2,8 @@ import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_user_apis.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -22,7 +22,7 @@ class MihPersonalSettings extends StatefulWidget {
|
||||
class _MihPersonalSettingsState extends State<MihPersonalSettings> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(borderOn: true, bodyItem: getBody());
|
||||
return MihPackageToolBody(borderOn: true, bodyItem: getBody());
|
||||
}
|
||||
|
||||
void deleteAccountPopUp(BuildContext ctxtd) {
|
||||
@@ -30,7 +30,7 @@ class _MihPersonalSettingsState extends State<MihPersonalSettings> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MihAppAlert(
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
|
||||
@@ -4,10 +4,8 @@ import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_wallet_apis.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart';
|
||||
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';
|
||||
@@ -50,85 +48,86 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Edit Loyalty Card",
|
||||
windowTools: const [
|
||||
SizedBox(width: 35),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
_cardNumberController.clear();
|
||||
_nicknameController.clear();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHTextField(
|
||||
controller: _nicknameController,
|
||||
hintText: "Card Title",
|
||||
editable: true,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
child: MIHNumberField(
|
||||
controller: _cardNumberController,
|
||||
hintText: "Card Number",
|
||||
editable: true,
|
||||
required: true,
|
||||
enableDecimal: false,
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
MIHTextField(
|
||||
controller: _nicknameController,
|
||||
hintText: "Card Title",
|
||||
editable: true,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
child: MIHNumberField(
|
||||
controller: _cardNumberController,
|
||||
hintText: "Card Number",
|
||||
editable: true,
|
||||
required: true,
|
||||
enableDecimal: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
MIHButton(
|
||||
onTap: () async {
|
||||
openscanner();
|
||||
const SizedBox(width: 10),
|
||||
MIHButton(
|
||||
onTap: () async {
|
||||
openscanner();
|
||||
},
|
||||
buttonText: "Scan",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (_cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
widget.cardList[index].favourite,
|
||||
widget.cardList[index].priority_index,
|
||||
_nicknameController.text,
|
||||
_cardNumberController.text,
|
||||
0,
|
||||
ctxt,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Scan",
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (_cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
widget.cardList[index].favourite,
|
||||
widget.cardList[index].priority_index,
|
||||
_nicknameController.text,
|
||||
_cardNumberController.text,
|
||||
0,
|
||||
ctxt,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -157,7 +156,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MihAppAlert(
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.favorite,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
@@ -213,7 +212,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MihAppAlert(
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.favorite_border,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
@@ -276,102 +275,82 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MihAppWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: widget.cardList[index].shop_name.toUpperCase(),
|
||||
windowTools: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5.0),
|
||||
child: MihFloatingMenu(
|
||||
animatedIcon: AnimatedIcons.menu_close,
|
||||
direction: SpeedDialDirection.down,
|
||||
children: [
|
||||
SpeedDialChild(
|
||||
child: widget.cardList[index].favourite == ""
|
||||
? Icon(
|
||||
Icons.favorite,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
)
|
||||
: Icon(
|
||||
Icons.favorite_border,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
label: widget.cardList[index].favourite == ""
|
||||
? "Add to Favourite"
|
||||
: "Remove from Favourite",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
if (widget.cardList[index].favourite == "") {
|
||||
addToFavCardWindow(context, index);
|
||||
} else {
|
||||
removeFromFavCardWindow(context, index);
|
||||
}
|
||||
},
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: widget.cardList[index].favourite == ""
|
||||
? Icon(
|
||||
Icons.favorite,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
)
|
||||
: Icon(
|
||||
Icons.favorite_border,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Edit Card Details",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_cardNumberController.text =
|
||||
widget.cardList[index].card_number;
|
||||
_nicknameController.text =
|
||||
widget.cardList[index].nickname;
|
||||
});
|
||||
editCardWindow(context, index);
|
||||
},
|
||||
),
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Card",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
deleteCardWindow(context, index);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
label: widget.cardList[index].favourite == ""
|
||||
? "Add to Favourite"
|
||||
: "Remove from Favourite",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
],
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
if (widget.cardList[index].favourite == "") {
|
||||
addToFavCardWindow(context, index);
|
||||
} else {
|
||||
removeFromFavCardWindow(context, index);
|
||||
}
|
||||
},
|
||||
),
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Edit Card Details",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_cardNumberController.text = widget.cardList[index].card_number;
|
||||
_nicknameController.text = widget.cardList[index].nickname;
|
||||
});
|
||||
editCardWindow(context, index);
|
||||
},
|
||||
),
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Card",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
deleteCardWindow(context, index);
|
||||
},
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/package_tools/mih_card_favourites.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/package_tools/mih_cards.dart';
|
||||
@@ -32,7 +32,7 @@ class _MihWalletState extends State<MihWallet> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -46,8 +46,8 @@ class _MihWalletState extends State<MihWallet> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -57,7 +57,7 @@ class _MihWalletState extends State<MihWallet> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.card_membership)] = () {
|
||||
setState(() {
|
||||
@@ -70,7 +70,7 @@ class _MihWalletState extends State<MihWallet> {
|
||||
});
|
||||
};
|
||||
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -22,7 +22,7 @@ class MihWalletTile extends StatefulWidget {
|
||||
class _MihWalletTileState extends State<MihWalletTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-wallet',
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_wallet_apis.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/loyalty_card.dart';
|
||||
@@ -33,7 +33,7 @@ class _MihCardFavouritesState extends State<MihCardFavourites> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -7,9 +7,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
@@ -81,21 +81,9 @@ class _MihCardsState extends State<MihCards> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Add New Loyalty Card",
|
||||
windowTools: const [
|
||||
SizedBox(width: 35),
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
// //Delete card API Call
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.delete,
|
||||
// color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
shopController.clear();
|
||||
cardNumberController.clear();
|
||||
@@ -103,145 +91,148 @@ class _MihCardsState extends State<MihCards> {
|
||||
shopName.value = "";
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHDropdownField(
|
||||
controller: shopController,
|
||||
hintText: "Shop Name",
|
||||
dropdownOptions: const [
|
||||
"+More",
|
||||
"Apple Tree",
|
||||
"Auchan",
|
||||
"Best Before",
|
||||
"Big Save",
|
||||
"Boxer",
|
||||
"BP",
|
||||
"Builders Warehouse",
|
||||
"Checkers",
|
||||
"Choppies",
|
||||
"Clicks",
|
||||
"Continente",
|
||||
"Cotton:On",
|
||||
"Carrefour",
|
||||
"Dis-Chem",
|
||||
"Edgars",
|
||||
"Eskom",
|
||||
"Exclusive Books",
|
||||
"Fresh Stop",
|
||||
"Fresmart",
|
||||
"Infinity",
|
||||
"Jet",
|
||||
"Justrite",
|
||||
"Kero",
|
||||
"Leroy Merlin",
|
||||
"Makro",
|
||||
"Naivas",
|
||||
"OK Foods",
|
||||
"Panarottis",
|
||||
"Pick n Pay",
|
||||
"PnA",
|
||||
"PQ Clothing",
|
||||
"Rage",
|
||||
"Sefalana",
|
||||
"Sasol",
|
||||
"Shell",
|
||||
"Shoprite",
|
||||
"Signature Cosmetics & Fragrances",
|
||||
"Spar",
|
||||
"Spur",
|
||||
"TFG Group",
|
||||
"Toys R Us",
|
||||
"Woermann Brock",
|
||||
"Woolworths"
|
||||
],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: shopName,
|
||||
builder: (BuildContext context, String value, Widget? child) {
|
||||
return Visibility(
|
||||
visible: value != "",
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
MihCardDisplay(
|
||||
shopName: shopName.value, nickname: "", height: 200),
|
||||
],
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHDropdownField(
|
||||
controller: shopController,
|
||||
hintText: "Shop Name",
|
||||
dropdownOptions: const [
|
||||
"+More",
|
||||
"Apple Tree",
|
||||
"Auchan",
|
||||
"Best Before",
|
||||
"Big Save",
|
||||
"Boxer",
|
||||
"BP",
|
||||
"Builders Warehouse",
|
||||
"Checkers",
|
||||
"Choppies",
|
||||
"Clicks",
|
||||
"Continente",
|
||||
"Cotton:On",
|
||||
"Carrefour",
|
||||
"Dis-Chem",
|
||||
"Edgars",
|
||||
"Eskom",
|
||||
"Exclusive Books",
|
||||
"Fresh Stop",
|
||||
"Fresmart",
|
||||
"Infinity",
|
||||
"Jet",
|
||||
"Justrite",
|
||||
"Kero",
|
||||
"Leroy Merlin",
|
||||
"Makro",
|
||||
"Naivas",
|
||||
"OK Foods",
|
||||
"Panarottis",
|
||||
"Pick n Pay",
|
||||
"PnA",
|
||||
"PQ Clothing",
|
||||
"Rage",
|
||||
"Sefalana",
|
||||
"Sasol",
|
||||
"Shell",
|
||||
"Shoprite",
|
||||
"Signature Cosmetics & Fragrances",
|
||||
"Spar",
|
||||
"Spur",
|
||||
"TFG Group",
|
||||
"Toys R Us",
|
||||
"Woermann Brock",
|
||||
"Woolworths"
|
||||
],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: shopName,
|
||||
builder: (BuildContext context, String value, Widget? child) {
|
||||
return Visibility(
|
||||
visible: value != "",
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
MihCardDisplay(
|
||||
shopName: shopName.value, nickname: "", height: 200),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MIHTextField(
|
||||
controller: _nicknameController,
|
||||
hintText: "Card Title",
|
||||
editable: true,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
child: MIHNumberField(
|
||||
controller: cardNumberController,
|
||||
hintText: "Card Number",
|
||||
editable: true,
|
||||
required: true,
|
||||
enableDecimal: false,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MIHTextField(
|
||||
controller: _nicknameController,
|
||||
hintText: "Card Title",
|
||||
editable: true,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
child: MIHNumberField(
|
||||
controller: cardNumberController,
|
||||
hintText: "Card Number",
|
||||
editable: true,
|
||||
required: true,
|
||||
enableDecimal: false,
|
||||
const SizedBox(width: 10),
|
||||
MIHButton(
|
||||
onTap: () async {
|
||||
openscanner();
|
||||
},
|
||||
buttonText: "Scan",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
MIHButton(
|
||||
onTap: () async {
|
||||
openscanner();
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (shopController.text == "" ||
|
||||
cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.addLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.signedInUser.app_id,
|
||||
shopController.text,
|
||||
cardNumberController.text,
|
||||
"",
|
||||
0,
|
||||
_nicknameController.text,
|
||||
0,
|
||||
context,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Scan",
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (shopController.text == "" ||
|
||||
cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.addLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.signedInUser.app_id,
|
||||
shopController.text,
|
||||
cardNumberController.text,
|
||||
"",
|
||||
0,
|
||||
_nicknameController.text,
|
||||
0,
|
||||
context,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -269,7 +260,7 @@ class _MihCardsState extends State<MihCards> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_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_success_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
|
||||
@@ -167,75 +167,77 @@ class _BuildPatientsListState extends State<BuildMihPatientSearchList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Patient Appointment",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDateField(
|
||||
controller: dateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTimeField(
|
||||
controller: timeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Book",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
//print("here1");
|
||||
bool filled = isAppointmentFieldsFilled();
|
||||
//print("fields filled: $filled");
|
||||
if (filled) {
|
||||
//print("here2");
|
||||
submitApointment(index);
|
||||
//print("here3");
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDateField(
|
||||
controller: dateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTimeField(
|
||||
controller: timeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Book",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
//print("here1");
|
||||
bool filled = isAppointmentFieldsFilled();
|
||||
//print("fields filled: $filled");
|
||||
if (filled) {
|
||||
//print("here2");
|
||||
submitApointment(index);
|
||||
//print("here3");
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -321,226 +323,230 @@ class _BuildPatientsListState extends State<BuildMihPatientSearchList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Patient Profile",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: accessStatusController,
|
||||
hintText: "Access Status",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
Visibility(
|
||||
visible: !hasAccess,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Important Notice: Requesting Patient Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"You are about to request access to a patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 600,
|
||||
child: Text(
|
||||
"1. Permanent Access: Once the patient accepts your access request, it will become permanent.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 600,
|
||||
child: Text(
|
||||
"2. Shared Information: Any updates you make to the patient's profile will be visible to others who have access to the profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 600,
|
||||
child: Text(
|
||||
"3. Irreversible Access: Once granted, you cannot revoke your access to the patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"By pressing the \"Request Access\" button you accept the above terms.\n",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 15.0),
|
||||
Wrap(runSpacing: 10, spacing: 10, children: [
|
||||
// Visibility(
|
||||
// visible: hasAccess,
|
||||
// child: SizedBox(
|
||||
// width: 300,
|
||||
// height: 50,
|
||||
// child: MIHButton(
|
||||
// buttonText: "Book Appointment",
|
||||
// buttonColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
// textColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
// onTap: () {
|
||||
// if (hasAccess) {
|
||||
// appointmentPopUp(index);
|
||||
// } else {
|
||||
// noAccessWarning();
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Visibility(
|
||||
visible: hasAccess,
|
||||
child: SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "View Patient Profile",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (hasAccess) {
|
||||
Navigator.of(context)
|
||||
.pushNamed('/patient-manager/patient',
|
||||
arguments: PatientViewArguments(
|
||||
widget.signedInUser,
|
||||
widget.patients[index],
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
"business",
|
||||
));
|
||||
} else {
|
||||
noAccessWarning();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: accessStatusController,
|
||||
hintText: "Access Status",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
Visibility(
|
||||
visible: !hasAccess && accessStatus == "No Access",
|
||||
child: SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Request Access",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
//print("Send access Request...");
|
||||
MIHApiCalls.addPatientAccessAPICall(
|
||||
widget.business!.business_id,
|
||||
widget.patients[index].app_id,
|
||||
"patient",
|
||||
widget.business!.Name,
|
||||
widget.personalSelected,
|
||||
BusinessArguments(
|
||||
widget.signedInUser,
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
visible: !hasAccess,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Important Notice: Requesting Patient Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"You are about to request access to a patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 600,
|
||||
child: Text(
|
||||
"1. Permanent Access: Once the patient accepts your access request, it will become permanent.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
context,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !hasAccess && accessStatus == "declined",
|
||||
child: SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Re-apply",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
// print("Send rewaply access Request...");
|
||||
MIHApiCalls.reapplyPatientAccessAPICall(
|
||||
widget.business!.business_id,
|
||||
widget.patients[index].app_id,
|
||||
widget.personalSelected,
|
||||
BusinessArguments(
|
||||
widget.signedInUser,
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 600,
|
||||
child: Text(
|
||||
"2. Shared Information: Any updates you make to the patient's profile will be visible to others who have access to the profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
context,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 600,
|
||||
child: Text(
|
||||
"3. Irreversible Access: Once granted, you cannot revoke your access to the patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"By pressing the \"Request Access\" button you accept the above terms.\n",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 15.0),
|
||||
Wrap(runSpacing: 10, spacing: 10, children: [
|
||||
// Visibility(
|
||||
// visible: hasAccess,
|
||||
// child: SizedBox(
|
||||
// width: 300,
|
||||
// height: 50,
|
||||
// child: MIHButton(
|
||||
// buttonText: "Book Appointment",
|
||||
// buttonColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
// textColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
// onTap: () {
|
||||
// if (hasAccess) {
|
||||
// appointmentPopUp(index);
|
||||
// } else {
|
||||
// noAccessWarning();
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Visibility(
|
||||
visible: hasAccess,
|
||||
child: SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "View Patient Profile",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (hasAccess) {
|
||||
Navigator.of(context)
|
||||
.pushNamed('/patient-manager/patient',
|
||||
arguments: PatientViewArguments(
|
||||
widget.signedInUser,
|
||||
widget.patients[index],
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
"business",
|
||||
));
|
||||
} else {
|
||||
noAccessWarning();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !hasAccess && accessStatus == "pending",
|
||||
child: const SizedBox(
|
||||
width: 500,
|
||||
//height: 50,
|
||||
child: Text(
|
||||
"Patient has not approved access to their profile. Once access has been approved you can book and appointment or view their profile."),
|
||||
Visibility(
|
||||
visible: !hasAccess && accessStatus == "No Access",
|
||||
child: SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Request Access",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
//print("Send access Request...");
|
||||
MIHApiCalls.addPatientAccessAPICall(
|
||||
widget.business!.business_id,
|
||||
widget.patients[index].app_id,
|
||||
"patient",
|
||||
widget.business!.Name,
|
||||
widget.personalSelected,
|
||||
BusinessArguments(
|
||||
widget.signedInUser,
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
),
|
||||
context,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
])
|
||||
],
|
||||
Visibility(
|
||||
visible: !hasAccess && accessStatus == "declined",
|
||||
child: SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Re-apply",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
// print("Send rewaply access Request...");
|
||||
MIHApiCalls.reapplyPatientAccessAPICall(
|
||||
widget.business!.business_id,
|
||||
widget.patients[index].app_id,
|
||||
widget.personalSelected,
|
||||
BusinessArguments(
|
||||
widget.signedInUser,
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
),
|
||||
context,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !hasAccess && accessStatus == "pending",
|
||||
child: const SizedBox(
|
||||
width: 500,
|
||||
//height: 50,
|
||||
child: Text(
|
||||
"Patient has not approved access to their profile. Once access has been approved you can book and appointment or view their profile."),
|
||||
),
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_date_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_time_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_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_warning_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
@@ -100,75 +100,77 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Patient Appointment",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDateField(
|
||||
controller: dateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTimeField(
|
||||
controller: timeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Book",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
//print("here1");
|
||||
bool filled = isAppointmentFieldsFilled();
|
||||
//print("fields filled: $filled");
|
||||
if (filled) {
|
||||
//print("here2");
|
||||
submitApointment(index);
|
||||
//print("here3");
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDateField(
|
||||
controller: dateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTimeField(
|
||||
controller: timeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Book",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
//print("here1");
|
||||
bool filled = isAppointmentFieldsFilled();
|
||||
//print("fields filled: $filled");
|
||||
if (filled) {
|
||||
//print("here2");
|
||||
submitApointment(index);
|
||||
//print("here3");
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -214,74 +216,75 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Patient Profile",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
Wrap(runSpacing: 10, spacing: 10, children: [
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Book Appointment",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
appointmentPopUp(index);
|
||||
},
|
||||
),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
hintText: "ID No.",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "View Patient Profile",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
// Navigator.of(context).pop();
|
||||
Navigator.of(context).pushNamed('/patient-manager/patient',
|
||||
arguments: PatientViewArguments(
|
||||
widget.signedInUser,
|
||||
patientProfile,
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
"business",
|
||||
));
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: fnameController,
|
||||
hintText: "First Name",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
])
|
||||
],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: lnameController,
|
||||
hintText: "Surname",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
Wrap(runSpacing: 10, spacing: 10, children: [
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Book Appointment",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
appointmentPopUp(index);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "View Patient Profile",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
// Navigator.of(context).pop();
|
||||
Navigator.of(context).pushNamed('/patient-manager/patient',
|
||||
arguments: PatientViewArguments(
|
||||
widget.signedInUser,
|
||||
patientProfile,
|
||||
widget.businessUser,
|
||||
widget.business,
|
||||
"business",
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -20,7 +20,7 @@ class PatManagerTile extends StatefulWidget {
|
||||
class _PatManagerTileState extends State<PatManagerTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/patient-manager',
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_api_calls.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_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-app_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_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
@@ -221,7 +221,7 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getPatientSearch(),
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_api_calls.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_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-app_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_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
@@ -201,7 +201,7 @@ class _MyPatientListState extends State<MyPatientList> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: myPatientListTool(),
|
||||
);
|
||||
|
||||
@@ -8,9 +8,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
@@ -222,71 +222,73 @@ class _WaitingRoomState extends State<WaitingRoom> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Appointment Type",
|
||||
windowTools: [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
windowBody: [
|
||||
Text(
|
||||
question,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
widget.onIndexChange(1);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonText: "Existing Patient",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
Text(
|
||||
question,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor()),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
widget.onIndexChange(2);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonText: "Existing MIH User",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
widget.onIndexChange(1);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonText: "Existing Patient",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
addAppointmentWindow();
|
||||
},
|
||||
buttonText: "Skeleton Appointment",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
widget.onIndexChange(2);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonText: "Existing MIH User",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
addAppointmentWindow();
|
||||
},
|
||||
buttonText: "Skeleton Appointment",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -297,10 +299,9 @@ class _WaitingRoomState extends State<WaitingRoom> {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Add Appointment",
|
||||
windowTools: [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.of(context).pop();
|
||||
_appointmentDateController.clear();
|
||||
@@ -309,61 +310,63 @@ class _WaitingRoomState extends State<WaitingRoom> {
|
||||
_appointmentDescriptionIDController.clear();
|
||||
_patientController.clear();
|
||||
},
|
||||
windowBody: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: _appointmentTitleController,
|
||||
hintText: "Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
windowBody: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTextField(
|
||||
controller: _appointmentTitleController,
|
||||
hintText: "Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHDateField(
|
||||
controller: _appointmentDateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHDateField(
|
||||
controller: _appointmentDateController,
|
||||
lableText: "Date",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTimeField(
|
||||
controller: _appointmentTimeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
child: MIHTimeField(
|
||||
controller: _appointmentTimeController,
|
||||
lableText: "Time",
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: _appointmentDescriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: true,
|
||||
required: true,
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
// width: 500,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: _appointmentDescriptionIDController,
|
||||
hintText: "Description",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
addAppointmentCall();
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
addAppointmentCall();
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -450,7 +453,7 @@ class _WaitingRoomState extends State<WaitingRoom> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBusinessAppointmentsTool(),
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_manager/package_tools/mih_patient_search.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_manager/package_tools/my_patient_list.dart';
|
||||
@@ -29,7 +29,7 @@ class _PatManagerState extends State<PatManager> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getActionButton(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -42,8 +42,8 @@ class _PatManagerState extends State<PatManager> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getActionButton() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getActionButton() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -53,7 +53,7 @@ class _PatManagerState extends State<PatManager> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.calendar_month)] = () {
|
||||
setState(() {
|
||||
@@ -72,7 +72,7 @@ class _PatManagerState extends State<PatManager> {
|
||||
_selcetedIndex = 2;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_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_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
@@ -389,10 +389,9 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Generate Claim/ Statement Document",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
// medicineController.clear();
|
||||
// quantityController.clear();
|
||||
@@ -402,9 +401,7 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
|
||||
// noRepeatsController.clear();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
getWindowBody(),
|
||||
],
|
||||
windowBody: getWindowBody(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/icd10_code.dart.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/list_builders/build_icd10_code_list.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -37,10 +37,9 @@ class _ICD10SearchWindowState extends State<ICD10SearchWindow> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "ICD-10 Search",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
// medicineController.clear();
|
||||
// quantityController.clear();
|
||||
@@ -50,9 +49,7 @@ class _ICD10SearchWindowState extends State<ICD10SearchWindow> {
|
||||
// noRepeatsController.clear();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
getWindowBody(),
|
||||
],
|
||||
windowBody: getWindowBody(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
@@ -66,47 +65,48 @@ class _MedicineSearchState extends State<MedicineSearch> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MIHWindow(
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Select Medicine",
|
||||
windowTools: [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
FutureBuilder(
|
||||
future: futueMeds,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Mihloadingcircle(),
|
||||
);
|
||||
} else if (snapshot.hasData && snapshot.data!.isNotEmpty) {
|
||||
final medsList = snapshot.data!;
|
||||
return SizedBox(
|
||||
height: 400,
|
||||
child: BuildMedicinesList(
|
||||
contoller: widget.searchVlaue,
|
||||
medicines: medsList,
|
||||
//searchString: searchString,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"No Match Found\nPlease close and manually capture medicine",
|
||||
style: TextStyle(fontSize: 25, color: Colors.grey),
|
||||
textAlign: TextAlign.center,
|
||||
windowBody: Column(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
future: futueMeds,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Mihloadingcircle(),
|
||||
);
|
||||
} else if (snapshot.hasData && snapshot.data!.isNotEmpty) {
|
||||
final medsList = snapshot.data!;
|
||||
return SizedBox(
|
||||
height: 400,
|
||||
child: BuildMedicinesList(
|
||||
contoller: widget.searchVlaue,
|
||||
medicines: medsList,
|
||||
//searchString: searchString,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"No Match Found\nPlease close and manually capture medicine",
|
||||
style: TextStyle(fontSize: 25, color: Colors.grey),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:fl_downloader/fl_downloader.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.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_file_api.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
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/app_user.dart';
|
||||
@@ -14,6 +19,9 @@ import 'package:mzansi_innovation_hub/mih_objects/claim_statement_file.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/patients.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/list_builders/build_file_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
import 'package:http/http.dart' as http2;
|
||||
import "package:universal_html/html.dart" as html;
|
||||
|
||||
class BuildClaimStatementFileList extends StatefulWidget {
|
||||
final AppUser signedInUser;
|
||||
@@ -45,6 +53,8 @@ class _BuildClaimStatementFileListState
|
||||
final baseAPI = AppEnviroment.baseApiUrl;
|
||||
final basefile = AppEnviroment.baseFileUrl;
|
||||
String fileUrl = "";
|
||||
int progress = 0;
|
||||
late StreamSubscription progressStream;
|
||||
|
||||
Future<String> getFileUrlApiCall(String filePath) async {
|
||||
String teporaryFileUrl = "";
|
||||
@@ -105,42 +115,149 @@ class _BuildClaimStatementFileListState
|
||||
);
|
||||
}
|
||||
|
||||
String getFileName(String path) {
|
||||
//print(pdfLink.split(".")[1]);
|
||||
return path.split("/").last;
|
||||
}
|
||||
|
||||
void printDocument(String link, String path) async {
|
||||
http2.Response response = await http.get(Uri.parse(link));
|
||||
var pdfData = response.bodyBytes;
|
||||
Navigator.of(context).pushNamed(
|
||||
'/file-veiwer/print-preview',
|
||||
arguments: PrintPreviewArguments(
|
||||
pdfData,
|
||||
getFileName(path),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void nativeFileDownload(String fileLink) async {
|
||||
var permission = await FlDownloader.requestPermission();
|
||||
if (permission == StoragePermissionStatus.granted) {
|
||||
try {
|
||||
mihLoadingPopUp();
|
||||
await FlDownloader.download(fileLink);
|
||||
Navigator.of(context).pop();
|
||||
} on Exception catch (error) {
|
||||
Navigator.of(context).pop();
|
||||
print(error);
|
||||
}
|
||||
} else {
|
||||
print("denied");
|
||||
}
|
||||
}
|
||||
|
||||
void viewFilePopUp(String fileName, String filePath, int fileID, String url) {
|
||||
bool hasAccessToDelete = false;
|
||||
if (widget.type == "business") {
|
||||
hasAccessToDelete = true;
|
||||
}
|
||||
|
||||
List<SpeedDialChild>? menuList = [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.download,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Download",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "Web") {
|
||||
html.window.open(url, 'download');
|
||||
} else {
|
||||
nativeFileDownload(url);
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
menuList.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.print,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Print",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
printDocument(url, filePath);
|
||||
},
|
||||
),
|
||||
);
|
||||
menuList.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.fullscreen,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Full Screen",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
printDocument(url, filePath);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
if (hasAccessToDelete) {
|
||||
menuList.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Document",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
deleteFilePopUp(filePath, fileID);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
fullscreen: true,
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: fileName,
|
||||
windowBody: [
|
||||
BuildFileView(
|
||||
link: url,
|
||||
path: filePath,
|
||||
//pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
)
|
||||
],
|
||||
windowTools: [
|
||||
Visibility(
|
||||
visible: hasAccessToDelete,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
deleteFilePopUp(filePath, fileID);
|
||||
},
|
||||
icon: Icon(
|
||||
size: 35,
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
BuildFileView(
|
||||
link: url,
|
||||
path: filePath,
|
||||
//pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
)
|
||||
],
|
||||
),
|
||||
menuOptions: menuList,
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
@@ -148,12 +265,41 @@ class _BuildClaimStatementFileListState
|
||||
);
|
||||
}
|
||||
|
||||
void mihLoadingPopUp() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const Mihloadingcircle();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
FlDownloader.initialize();
|
||||
progressStream = FlDownloader.progressStream.listen((event) {
|
||||
if (event.status == DownloadStatus.successful) {
|
||||
setState(() {
|
||||
progress = event.progress;
|
||||
});
|
||||
//Navigator.of(context).pop();
|
||||
print("Progress $progress%: Success Downloading");
|
||||
FlDownloader.openFile(filePath: event.filePath);
|
||||
} else if (event.status == DownloadStatus.failed) {
|
||||
print("Progress $progress%: Error Downloading");
|
||||
} else if (event.status == DownloadStatus.running) {
|
||||
print("Progress $progress%: Download Running");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.files.isNotEmpty) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncfusion_flutter_core/theme.dart';
|
||||
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
|
||||
import "package:universal_html/html.dart" as html;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:fl_downloader/fl_downloader.dart';
|
||||
|
||||
@@ -115,149 +114,29 @@ class _BuildFileViewState extends State<BuildFileView> {
|
||||
//double height = MediaQuery.sizeOf(context).height;
|
||||
debugPrint(widget.link);
|
||||
if (getExtType(widget.path).toLowerCase() == "pdf") {
|
||||
return Expanded(
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
SfPdfViewerTheme(
|
||||
data: SfPdfViewerThemeData(
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
child: SfPdfViewer.network(
|
||||
widget.link,
|
||||
controller: pdfViewerController,
|
||||
interactionMode: PdfInteractionMode.pan,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: IconButton.filled(
|
||||
iconSize: 35,
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: () {
|
||||
printDocument();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.print,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: IconButton.filled(
|
||||
iconSize: 35,
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: () async {
|
||||
// debugPrint(
|
||||
// "I'm here ${MzanziInnovationHub.of(context)!.theme.getPlatform()}");
|
||||
if (MzanziInnovationHub.of(context)!.theme.getPlatform() ==
|
||||
"Web") {
|
||||
html.window.open(
|
||||
widget.link,
|
||||
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
'download');
|
||||
} else {
|
||||
// print("Here");
|
||||
// var permission = await FlDownloader.requestPermission();
|
||||
// if (permission == StoragePermissionStatus.granted) {
|
||||
// await FlDownloader.download(widget.link);
|
||||
// } else {
|
||||
// print("denied");
|
||||
// }
|
||||
nativeFileDownload(widget.link);
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.download,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
return SizedBox(
|
||||
height: 500,
|
||||
child: SfPdfViewerTheme(
|
||||
data: SfPdfViewerThemeData(
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
child: SfPdfViewer.network(
|
||||
widget.link,
|
||||
controller: pdfViewerController,
|
||||
interactionMode: PdfInteractionMode.pan,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Expanded(
|
||||
// height: height,
|
||||
// padding: const EdgeInsets.all(10.0),
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
InteractiveViewer(
|
||||
//constrained: true,
|
||||
//clipBehavior: Clip.antiAlias,
|
||||
maxScale: 5.0,
|
||||
//minScale: 0.,
|
||||
child: Image.network(widget.link),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: IconButton.filled(
|
||||
iconSize: 35,
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: () {
|
||||
//expandImage(width, height);
|
||||
Navigator.of(context).pushNamed(
|
||||
'/file-veiwer',
|
||||
arguments: FileViewArguments(
|
||||
widget.link,
|
||||
widget.path,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.fullscreen,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: IconButton.filled(
|
||||
iconSize: 35,
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: () async {
|
||||
// debugPrint("I'm here ");
|
||||
// debugPrint(
|
||||
// "I'm here ${MzanziInnovationHub.of(context)!.theme.getPlatform()}");
|
||||
if (MzanziInnovationHub.of(context)!.theme.getPlatform() ==
|
||||
"Web") {
|
||||
html.window.open(
|
||||
widget.link,
|
||||
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
'download');
|
||||
} else {
|
||||
//print("Here");
|
||||
// var permission = await FlDownloader.requestPermission();
|
||||
// if (permission == StoragePermissionStatus.granted) {
|
||||
// await FlDownloader.download(widget.link);
|
||||
// } else {
|
||||
// print("denied");
|
||||
// }
|
||||
nativeFileDownload(widget.link);
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.download,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
return SizedBox(
|
||||
height: 500,
|
||||
child: InteractiveViewer(
|
||||
//constrained: true,
|
||||
//clipBehavior: Clip.antiAlias,
|
||||
maxScale: 5.0,
|
||||
//minScale: 0.,
|
||||
child: Image.network(widget.link),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:fl_downloader/fl_downloader.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_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_loading_circle.dart';
|
||||
@@ -17,6 +20,8 @@ import 'package:mzansi_innovation_hub/mih_objects/patients.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/list_builders/build_file_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
import 'package:http/http.dart' as http2;
|
||||
import "package:universal_html/html.dart" as html;
|
||||
|
||||
class BuildFilesList extends StatefulWidget {
|
||||
final AppUser signedInUser;
|
||||
@@ -46,6 +51,8 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
final baseAPI = AppEnviroment.baseApiUrl;
|
||||
final basefile = AppEnviroment.baseFileUrl;
|
||||
String fileUrl = "";
|
||||
int progress = 0;
|
||||
late StreamSubscription progressStream;
|
||||
|
||||
Future<String> getFileUrlApiCall(String filePath) async {
|
||||
String teporaryFileUrl = "";
|
||||
@@ -158,147 +165,185 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
);
|
||||
}
|
||||
|
||||
String getFileName(String path) {
|
||||
//print(pdfLink.split(".")[1]);
|
||||
return path.split("/").last;
|
||||
}
|
||||
|
||||
void printDocument(String link, String path) async {
|
||||
http2.Response response = await http.get(Uri.parse(link));
|
||||
var pdfData = response.bodyBytes;
|
||||
Navigator.of(context).pushNamed(
|
||||
'/file-veiwer/print-preview',
|
||||
arguments: PrintPreviewArguments(
|
||||
pdfData,
|
||||
getFileName(path),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void nativeFileDownload(String fileLink) async {
|
||||
var permission = await FlDownloader.requestPermission();
|
||||
if (permission == StoragePermissionStatus.granted) {
|
||||
try {
|
||||
mihLoadingPopUp();
|
||||
await FlDownloader.download(fileLink);
|
||||
Navigator.of(context).pop();
|
||||
} on Exception catch (error) {
|
||||
Navigator.of(context).pop();
|
||||
print(error);
|
||||
}
|
||||
} else {
|
||||
print("denied");
|
||||
}
|
||||
}
|
||||
|
||||
void viewFilePopUp(String fileName, String filePath, int fileID, String url) {
|
||||
bool hasAccessToDelete = false;
|
||||
if (widget.type == "business") {
|
||||
hasAccessToDelete = true;
|
||||
}
|
||||
|
||||
List<SpeedDialChild>? menuList = [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.download,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Download",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "Web") {
|
||||
html.window.open(url, 'download');
|
||||
} else {
|
||||
nativeFileDownload(url);
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
if (filePath.split(".").last.toLowerCase() == "pdf") {
|
||||
menuList.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.print,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Print",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
printDocument(url, filePath);
|
||||
},
|
||||
),
|
||||
);
|
||||
menuList.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.fullscreen,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Full Screen",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
printDocument(url, filePath);
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
menuList.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.fullscreen,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Full Screen",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/file-veiwer',
|
||||
arguments: FileViewArguments(
|
||||
url,
|
||||
filePath,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
if (hasAccessToDelete) {
|
||||
menuList.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Document",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
deleteFilePopUp(filePath, fileID);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
fullscreen: true,
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: fileName,
|
||||
windowBody: [
|
||||
BuildFileView(
|
||||
link: url,
|
||||
path: filePath,
|
||||
//pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
)
|
||||
],
|
||||
windowTools: [
|
||||
Visibility(
|
||||
visible: hasAccessToDelete,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
deleteFilePopUp(filePath, fileID);
|
||||
},
|
||||
icon: Icon(
|
||||
size: 35,
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
windowBody: BuildFileView(
|
||||
link: url,
|
||||
path: filePath,
|
||||
//pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
),
|
||||
menuOptions: menuList,
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// barrierDismissible: false,
|
||||
// builder: (context) => Dialog(
|
||||
// child: Stack(
|
||||
// children: [
|
||||
// Container(
|
||||
// padding: const EdgeInsets.all(10.0),
|
||||
// width: 800.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: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// const SizedBox(
|
||||
// height: 25,
|
||||
// ),
|
||||
// Text(
|
||||
// fileName,
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(
|
||||
// color: MzanziInnovationHub.of(context)!
|
||||
// .theme
|
||||
// .secondaryColor(),
|
||||
// fontSize: 35.0,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 25.0),
|
||||
// Expanded(
|
||||
// child: BuildFileView(
|
||||
// link: url,
|
||||
// path: filePath,
|
||||
// //pdfLink: '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
// )),
|
||||
// const SizedBox(height: 30.0),
|
||||
// SizedBox(
|
||||
// width: 300,
|
||||
// height: 50,
|
||||
// child: MIHButton(
|
||||
// onTap: () {
|
||||
// html.window.open(
|
||||
// url,
|
||||
// // '${AppEnviroment.baseFileUrl}/mih/$filePath',
|
||||
// 'download');
|
||||
// },
|
||||
// buttonText: "Dowload",
|
||||
// buttonColor: MzanziInnovationHub.of(context)!
|
||||
// .theme
|
||||
// .secondaryColor(),
|
||||
// textColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// top: 5,
|
||||
// right: 5,
|
||||
// width: 50,
|
||||
// height: 50,
|
||||
// child: IconButton(
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.close,
|
||||
// color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
// size: 35,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// top: 5,
|
||||
// left: 5,
|
||||
// width: 50,
|
||||
// height: 50,
|
||||
// child: IconButton(
|
||||
// onPressed: () {
|
||||
// deleteFilePopUp(filePath, fileID);
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.delete,
|
||||
// color:
|
||||
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
|
||||
void mihLoadingPopUp() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const Mihloadingcircle();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -307,6 +352,26 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
FlDownloader.initialize();
|
||||
progressStream = FlDownloader.progressStream.listen((event) {
|
||||
if (event.status == DownloadStatus.successful) {
|
||||
setState(() {
|
||||
progress = event.progress;
|
||||
});
|
||||
//Navigator.of(context).pop();
|
||||
print("Progress $progress%: Success Downloading");
|
||||
FlDownloader.openFile(filePath: event.filePath);
|
||||
} else if (event.status == DownloadStatus.failed) {
|
||||
print("Progress $progress%: Error Downloading");
|
||||
} else if (event.status == DownloadStatus.running) {
|
||||
print("Progress $progress%: Download Running");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.files.isNotEmpty) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_multiline_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_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_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
@@ -136,202 +137,80 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
fullscreen: true,
|
||||
windowTitle: selectednote.note_name,
|
||||
windowTools: [
|
||||
Visibility(
|
||||
visible: hasAccessToDelete,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
deletePatientPopUp(selectednote.idpatient_notes);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.delete,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Note Details",
|
||||
menuOptions: hasAccessToDelete
|
||||
? [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
label: "Delete Document",
|
||||
labelBackgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
labelStyle: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
onTap: () {
|
||||
deletePatientPopUp(selectednote.idpatient_notes);
|
||||
},
|
||||
),
|
||||
]
|
||||
: null,
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHTextField(
|
||||
controller: businessNameController,
|
||||
hintText: "Office",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: userNameController,
|
||||
hintText: "Created By",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: dateController,
|
||||
hintText: "Created Date",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: noteTitleController,
|
||||
hintText: "Note Title",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
Expanded(
|
||||
child: MIHMLTextField(
|
||||
controller: noteTextController,
|
||||
hintText: "Note Details",
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: businessNameController,
|
||||
hintText: "Office",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: userNameController,
|
||||
hintText: "Created By",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: dateController,
|
||||
hintText: "Created Date",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: noteTitleController,
|
||||
hintText: "Note Title",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
SizedBox(
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: noteTextController,
|
||||
hintText: "Note Details",
|
||||
editable: false,
|
||||
required: false,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// barrierDismissible: false,
|
||||
// builder: (context) => Dialog(
|
||||
// child: Stack(
|
||||
// children: [
|
||||
// Container(
|
||||
// padding: const EdgeInsets.all(15.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: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// const SizedBox(
|
||||
// height: 25,
|
||||
// ),
|
||||
// Text(
|
||||
// selectednote.note_name,
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(
|
||||
// color: MzanziInnovationHub.of(context)!
|
||||
// .theme
|
||||
// .secondaryColor(),
|
||||
// fontSize: 35.0,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 25.0),
|
||||
// SizedBox(
|
||||
// width: 700,
|
||||
// child: MIHTextField(
|
||||
// controller: businessNameController,
|
||||
// hintText: "Office",
|
||||
// editable: false,
|
||||
// required: false,
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 10.0),
|
||||
// SizedBox(
|
||||
// width: 700,
|
||||
// child: MIHTextField(
|
||||
// controller: userNameController,
|
||||
// hintText: "Created By",
|
||||
// editable: false,
|
||||
// required: false,
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 10.0),
|
||||
// SizedBox(
|
||||
// width: 700,
|
||||
// child: MIHTextField(
|
||||
// controller: dateController,
|
||||
// hintText: "Created Date",
|
||||
// editable: false,
|
||||
// required: false,
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 10.0),
|
||||
// SizedBox(
|
||||
// width: 700,
|
||||
// child: MIHTextField(
|
||||
// controller: noteTitleController,
|
||||
// hintText: "Note Title",
|
||||
// editable: false,
|
||||
// required: false,
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 10.0),
|
||||
// Expanded(
|
||||
// child: MIHMLTextField(
|
||||
// controller: noteTextController,
|
||||
// hintText: "Note Details",
|
||||
// editable: false,
|
||||
// required: false,
|
||||
// ),
|
||||
// ),
|
||||
// //const SizedBox(height: 25.0),
|
||||
// // SizedBox(
|
||||
// // width: 300,
|
||||
// // height: 100,
|
||||
// // child: MIHButton(
|
||||
// // onTap: () {
|
||||
// // Navigator.pop(context);
|
||||
// // },
|
||||
// // buttonText: "Close",
|
||||
// // buttonColor: Colors.blueAccent,
|
||||
// // textColor: Colors.white,
|
||||
// // ),
|
||||
// // )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// 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: () {
|
||||
// deletePatientPopUp(selectednote.idpatient_notes);
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.delete,
|
||||
// color:
|
||||
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,7 +21,7 @@ class PatientProfileTile extends StatefulWidget {
|
||||
class _PatientProfileTileState extends State<PatientProfileTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppTile(
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/patient-profile',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.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_components/mih_package_components/mih-app_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_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||
@@ -113,7 +113,7 @@ class _PatientClaimOrStatementState extends State<PatientClaimOrStatement> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -5,9 +5,9 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_multiline_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
@@ -84,106 +84,108 @@ class _PatientConsultationState extends State<PatientConsultation> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Add Note",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
titleController.clear();
|
||||
noteTextController.clear();
|
||||
},
|
||||
windowBody: [
|
||||
MIHTextField(
|
||||
controller: officeController,
|
||||
hintText: "Office",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: doctorController,
|
||||
hintText: "Created By",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: dateController,
|
||||
hintText: "Created Date",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: titleController,
|
||||
hintText: "Note Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
SizedBox(
|
||||
//width: 700,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: noteTextController,
|
||||
hintText: "Note Details",
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHTextField(
|
||||
controller: officeController,
|
||||
hintText: "Office",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: doctorController,
|
||||
hintText: "Created By",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: dateController,
|
||||
hintText: "Created Date",
|
||||
editable: false,
|
||||
required: true,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: titleController,
|
||||
hintText: "Note Title",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
child: ValueListenableBuilder(
|
||||
builder: (BuildContext context, int value, Widget? child) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"$value",
|
||||
style: TextStyle(
|
||||
color: getNoteDetailLimitColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"/512",
|
||||
style: TextStyle(
|
||||
color: getNoteDetailLimitColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
valueListenable: _counter,
|
||||
const SizedBox(height: 10.0),
|
||||
SizedBox(
|
||||
//width: 700,
|
||||
height: 250,
|
||||
child: MIHMLTextField(
|
||||
controller: noteTextController,
|
||||
hintText: "Note Details",
|
||||
editable: true,
|
||||
required: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (isFieldsFilled()) {
|
||||
addPatientNoteAPICall();
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
SizedBox(
|
||||
height: 15,
|
||||
child: ValueListenableBuilder(
|
||||
builder: (BuildContext context, int value, Widget? child) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"$value",
|
||||
style: TextStyle(
|
||||
color: getNoteDetailLimitColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"/512",
|
||||
style: TextStyle(
|
||||
color: getNoteDetailLimitColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Add Note",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
},
|
||||
valueListenable: _counter,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (isFieldsFilled()) {
|
||||
addPatientNoteAPICall();
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Add Note",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -316,7 +318,7 @@ class _PatientConsultationState extends State<PatientConsultation> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -7,9 +7,9 @@ import 'package:mzansi_innovation_hub/mih_components/med_cert_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_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_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
@@ -221,62 +221,64 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Upload File",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
MIHFileField(
|
||||
controller: selectedFileController,
|
||||
hintText: "Select File",
|
||||
editable: false,
|
||||
required: true,
|
||||
onPressed: () async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['jpg', 'png', 'pdf'],
|
||||
withData: true,
|
||||
);
|
||||
if (result == null) return;
|
||||
final selectedFile = result.files.first;
|
||||
print("Selected file: $selectedFile");
|
||||
setState(() {
|
||||
selected = selectedFile;
|
||||
});
|
||||
setState(() {
|
||||
selectedFileController.text = selectedFile.name;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Add File",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isFileFieldsFilled()) {
|
||||
submitDocUploadForm();
|
||||
// uploadSelectedFile(selected);
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHFileField(
|
||||
controller: selectedFileController,
|
||||
hintText: "Select File",
|
||||
editable: false,
|
||||
required: true,
|
||||
onPressed: () async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['jpg', 'png', 'pdf'],
|
||||
withData: true,
|
||||
);
|
||||
if (result == null) return;
|
||||
final selectedFile = result.files.first;
|
||||
print("Selected file: $selectedFile");
|
||||
setState(() {
|
||||
selected = selectedFile;
|
||||
});
|
||||
setState(() {
|
||||
selectedFileController.text = selectedFile.name;
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Add File",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () {
|
||||
if (isFileFieldsFilled()) {
|
||||
submitDocUploadForm();
|
||||
// uploadSelectedFile(selected);
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -285,44 +287,46 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Create Medical Certificate",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
Medcertinput(
|
||||
startDateController: startDateController,
|
||||
endDateTextController: endDateTextController,
|
||||
retDateTextController: retDateTextController,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Generate",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () async {
|
||||
if (isMedCertFieldsFilled()) {
|
||||
await generateMedCert();
|
||||
//Navigator.pop(context);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
Medcertinput(
|
||||
startDateController: startDateController,
|
||||
endDateTextController: endDateTextController,
|
||||
retDateTextController: retDateTextController,
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
buttonText: "Generate",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onTap: () async {
|
||||
if (isMedCertFieldsFilled()) {
|
||||
await generateMedCert();
|
||||
//Navigator.pop(context);
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -331,10 +335,9 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => MIHWindow(
|
||||
builder: (context) => MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: "Create Prescription",
|
||||
windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
medicineController.clear();
|
||||
quantityController.clear();
|
||||
@@ -344,22 +347,24 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
||||
noRepeatsController.clear();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
PrescripInput(
|
||||
medicineController: medicineController,
|
||||
quantityController: quantityController,
|
||||
dosageController: dosageController,
|
||||
timesDailyController: timesDailyController,
|
||||
noDaysController: noDaysController,
|
||||
noRepeatsController: noRepeatsController,
|
||||
outputController: outputController,
|
||||
selectedPatient: widget.selectedPatient,
|
||||
signedInUser: widget.signedInUser,
|
||||
business: widget.business,
|
||||
businessUser: widget.businessUser,
|
||||
env: env,
|
||||
),
|
||||
],
|
||||
windowBody: Column(
|
||||
children: [
|
||||
PrescripInput(
|
||||
medicineController: medicineController,
|
||||
quantityController: quantityController,
|
||||
dosageController: dosageController,
|
||||
timesDailyController: timesDailyController,
|
||||
noDaysController: noDaysController,
|
||||
noRepeatsController: noRepeatsController,
|
||||
outputController: outputController,
|
||||
selectedPatient: widget.selectedPatient,
|
||||
signedInUser: widget.signedInUser,
|
||||
business: widget.business,
|
||||
businessUser: widget.businessUser,
|
||||
env: env,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -594,7 +599,7 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_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_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
@@ -232,7 +232,7 @@ class _PatientInfoState extends State<PatientInfo> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihAppToolBody(
|
||||
return MihPackageToolBody(
|
||||
borderOn: true,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_tools.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_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/package_tools/patient_claim_or_statement.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/package_tools/patient_consultation.dart';
|
||||
@@ -23,7 +23,7 @@ class _PatientProfileState extends State<PatientProfile> {
|
||||
int _selcetedIndex = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihApp(
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
@@ -36,8 +36,8 @@ class _PatientProfileState extends State<PatientProfile> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppAction getAction() {
|
||||
return MihAppAction(
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -47,7 +47,7 @@ class _PatientProfileState extends State<PatientProfile> {
|
||||
);
|
||||
}
|
||||
|
||||
MihAppTools getTools() {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.perm_identity)] = () {
|
||||
setState(() {
|
||||
@@ -69,7 +69,7 @@ class _PatientProfileState extends State<PatientProfile> {
|
||||
_selcetedIndex = 3;
|
||||
});
|
||||
};
|
||||
return MihAppTools(
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
|
||||
@@ -50,7 +50,7 @@ class _MIHTestState extends State<MIHTest> {
|
||||
],
|
||||
),
|
||||
secondaryActionButton: null,
|
||||
body: MIHBody(
|
||||
body: const MIHBody(
|
||||
borderOn: false,
|
||||
bodyItems: [
|
||||
// YoutubePlayer(
|
||||
@@ -64,18 +64,5 @@ class _MIHTestState extends State<MIHTest> {
|
||||
pullDownToRefresh: false,
|
||||
onPullDown: () async {},
|
||||
);
|
||||
// return MIHWindow(
|
||||
// fullscreen: false,
|
||||
// windowTitle: "Test",
|
||||
// windowTools: const [],
|
||||
// onWindowTapClose: () {
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// windowBody: [
|
||||
// YoutubePlayer(
|
||||
// controller: videoController,
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user