Add secondary action and secondary action drawer
This commit is contained in:
@@ -5,9 +5,11 @@ import 'package:patient_manager/mih_components/mih_layout/mih_header.dart';
|
|||||||
|
|
||||||
class MIHLayoutBuilder extends StatefulWidget {
|
class MIHLayoutBuilder extends StatefulWidget {
|
||||||
final Widget actionButton;
|
final Widget actionButton;
|
||||||
|
final Widget? secondaryActionButton;
|
||||||
final MIHHeader header;
|
final MIHHeader header;
|
||||||
final MIHBody body;
|
final MIHBody body;
|
||||||
final MIHAppDrawer? rightDrawer;
|
final MIHAppDrawer? actionDrawer;
|
||||||
|
final MIHAppDrawer? secondaryActionDrawer;
|
||||||
final Widget? bottomNavBar;
|
final Widget? bottomNavBar;
|
||||||
|
|
||||||
//final String type;
|
//final String type;
|
||||||
@@ -15,8 +17,10 @@ class MIHLayoutBuilder extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.actionButton,
|
required this.actionButton,
|
||||||
required this.header,
|
required this.header,
|
||||||
|
required this.secondaryActionButton,
|
||||||
required this.body,
|
required this.body,
|
||||||
required this.rightDrawer,
|
required this.actionDrawer,
|
||||||
|
required this.secondaryActionDrawer,
|
||||||
required this.bottomNavBar,
|
required this.bottomNavBar,
|
||||||
//required this.type,
|
//required this.type,
|
||||||
});
|
});
|
||||||
@@ -52,7 +56,8 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
|
|||||||
Size screenSize = MediaQuery.sizeOf(context);
|
Size screenSize = MediaQuery.sizeOf(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
//drawerEnableOpenDragGesture: true,
|
//drawerEnableOpenDragGesture: true,
|
||||||
drawer: widget.rightDrawer,
|
drawer: widget.actionDrawer,
|
||||||
|
endDrawer: widget.secondaryActionButton,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: screenSize.width,
|
width: screenSize.width,
|
||||||
|
|||||||
@@ -324,9 +324,11 @@ class _MIHAboutState extends State<MIHAbout> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
|
secondaryActionButton: null,
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -349,8 +349,10 @@ class _PatientAccessRequestState extends State<PatientAccessRequest> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
// return Scaffold(
|
// return Scaffold(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/mih_packages/authentication/signin_or_register.dart';
|
import 'package:patient_manager/mih_packages/authentication/signin_or_register.dart';
|
||||||
import 'package:patient_manager/mih_packages/mih_home/home.dart';
|
import 'package:patient_manager/mih_packages/mih_home/MIH_Profile_Getter.dart';
|
||||||
import 'package:supertokens_flutter/supertokens.dart';
|
import 'package:supertokens_flutter/supertokens.dart';
|
||||||
|
|
||||||
class AuthCheck extends StatefulWidget {
|
class AuthCheck extends StatefulWidget {
|
||||||
@@ -30,7 +30,7 @@ class _AuthCheckState extends State<AuthCheck> {
|
|||||||
future: signedIn,
|
future: signedIn,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.data == true) {
|
if (snapshot.data == true) {
|
||||||
return const Home();
|
return const MIHProfileGetter();
|
||||||
} else {
|
} else {
|
||||||
return const SignInOrRegister();
|
return const SignInOrRegister();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -354,8 +354,10 @@ class _ForgotPasswordState extends State<ForgotPassword> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -410,8 +410,10 @@ class _RegisterState extends State<Register> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -412,8 +412,10 @@ class _ResetPasswordState extends State<ResetPassword> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -577,8 +577,10 @@ class _SignInState extends State<SignIn> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,9 +370,11 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
|
secondaryActionButton: null,
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
// return Scaffold(
|
// return Scaffold(
|
||||||
|
|||||||
@@ -435,9 +435,11 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
|
secondaryActionButton: null,
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -438,8 +438,10 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -395,8 +395,10 @@ class _AddPatientState extends State<AddPatient> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
// return Scaffold(
|
// return Scaffold(
|
||||||
|
|||||||
@@ -659,8 +659,10 @@ class _EditPatientState extends State<EditPatient> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
// return Scaffold(
|
// return Scaffold(
|
||||||
|
|||||||
@@ -415,8 +415,10 @@ class _PatientManagerState extends State<PatientManager> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
// return Scaffold(
|
// return Scaffold(
|
||||||
|
|||||||
@@ -179,8 +179,10 @@ class _PatientViewState extends State<PatientView> {
|
|||||||
return MIHLayoutBuilder(
|
return MIHLayoutBuilder(
|
||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
|
secondaryActionButton: null,
|
||||||
body: getBody(),
|
body: getBody(),
|
||||||
rightDrawer: null,
|
actionDrawer: null,
|
||||||
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
);
|
);
|
||||||
// return Scaffold(
|
// return Scaffold(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/mih_packages/authentication/auth_check.dart';
|
import 'package:patient_manager/mih_packages/authentication/auth_check.dart';
|
||||||
import 'package:patient_manager/mih_packages/mih_home/MIH_Profile_Getter.dart';
|
|
||||||
import 'package:patient_manager/mih_packages/patient_profile/add_or_view_patient.dart';
|
import 'package:patient_manager/mih_packages/patient_profile/add_or_view_patient.dart';
|
||||||
import 'package:patient_manager/mih_packages/patient_profile/patient_add.dart';
|
import 'package:patient_manager/mih_packages/patient_profile/patient_add.dart';
|
||||||
import 'package:patient_manager/mih_packages/patient_profile/patient_edit.dart';
|
import 'package:patient_manager/mih_packages/patient_profile/patient_edit.dart';
|
||||||
@@ -45,10 +44,6 @@ class RouteGenerator {
|
|||||||
settings: settings, builder: (_) => const ForgotPassword());
|
settings: settings, builder: (_) => const ForgotPassword());
|
||||||
//http://mzansi-innovation-hub.co.za/auth/reset-password
|
//http://mzansi-innovation-hub.co.za/auth/reset-password
|
||||||
//===============================================================
|
//===============================================================
|
||||||
//Home v2
|
|
||||||
case '/homev2':
|
|
||||||
return MaterialPageRoute(
|
|
||||||
settings: settings, builder: (_) => const MIHProfileGetter());
|
|
||||||
//About MIH
|
//About MIH
|
||||||
case '/about':
|
case '/about':
|
||||||
return MaterialPageRoute(
|
return MaterialPageRoute(
|
||||||
|
|||||||
Reference in New Issue
Block a user