Update loyout Builder and update all widgets that call it

This commit is contained in:
2024-10-01 11:52:02 +02:00
parent 2f05d66a95
commit 0c85d560a0
17 changed files with 71 additions and 11 deletions

View File

@@ -33,13 +33,11 @@ class _MIHActionState extends State<MIHAction> {
left: 5,
width: 50,
height: 50,
child: Builder(
builder: (context) => IconButton(
iconSize: widget.iconSize,
padding: const EdgeInsets.all(0),
onPressed: widget.onTap,
icon: widget.icon,
),
child: IconButton(
iconSize: widget.iconSize,
padding: const EdgeInsets.all(0),
onPressed: widget.onTap,
icon: widget.icon,
),
);
}

View File

@@ -1,17 +1,24 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/mih_components/mih_layout/mih_action.dart';
import 'package:patient_manager/mih_components/mih_layout/mih_app_drawer.dart';
import 'package:patient_manager/mih_components/mih_layout/mih_body.dart';
import 'package:patient_manager/mih_components/mih_layout/mih_header.dart';
class MIHLayoutBuilder extends StatefulWidget {
final MIHAction actionButton;
final Widget actionButton;
final MIHHeader header;
final MIHBody body;
final MIHAppDrawer? rightDrawer;
final Widget? bottomNavBar;
//final String type;
const MIHLayoutBuilder({
super.key,
required this.actionButton,
required this.header,
required this.body,
required this.rightDrawer,
required this.bottomNavBar,
//required this.type,
});
@override
@@ -26,6 +33,10 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
return temp;
}
// openTheDrawer() {
// _scaffoldKey.currentState!.openEndDrawer();
// }
@override
void dispose() {
super.dispose();
@@ -40,13 +51,17 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
Widget build(BuildContext context) {
Size screenSize = MediaQuery.sizeOf(context);
return Scaffold(
//drawerEnableOpenDragGesture: true,
drawer: widget.rightDrawer,
body: SafeArea(
child: SizedBox(
width: screenSize.width,
height: screenSize.height,
child: Stack(
children: [
widget.actionButton,
Builder(builder: (context) {
return widget.actionButton;
}),
Column(
children: [
widget.header,
@@ -57,6 +72,7 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
),
),
),
bottomNavigationBar: widget.bottomNavBar,
);
}
}

View File

@@ -326,6 +326,8 @@ class _MIHAboutState extends State<MIHAbout> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
}
}

View File

@@ -350,6 +350,8 @@ class _PatientAccessRequestState extends State<PatientAccessRequest> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
// return Scaffold(
// // appBar: const MIHAppBar(

View File

@@ -355,6 +355,8 @@ class _ForgotPasswordState extends State<ForgotPassword> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
}
}

View File

@@ -411,6 +411,8 @@ class _RegisterState extends State<Register> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
}
}

View File

@@ -413,6 +413,8 @@ class _ResetPasswordState extends State<ResetPassword> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
}
}

View File

@@ -578,6 +578,8 @@ class _SignInState extends State<SignIn> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
}
}

View File

@@ -372,6 +372,8 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
// return Scaffold(
// // appBar: const MIHAppBar(

View File

@@ -437,6 +437,8 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
// return Scaffold(

View File

@@ -416,6 +416,22 @@ class _HomeTileGridState extends State<HomeTileGrid> {
p: getPrim(),
s: getSec(),
));
tileList.add(MIHTile(
onTap: () {
Navigator.of(context).popAndPushNamed(
'/homev2',
arguments: widget.signedInUser,
);
},
tileName: "HomeV2 - Dev",
tileIcon: Icon(
Icons.home,
color: getSec(),
size: 200,
),
p: getPrim(),
s: getSec(),
));
}
}

View File

@@ -439,6 +439,8 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
}
}

View File

@@ -396,6 +396,8 @@ class _AddPatientState extends State<AddPatient> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
// return Scaffold(
// // appBar: const MIHAppBar(

View File

@@ -660,6 +660,8 @@ class _EditPatientState extends State<EditPatient> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
// return Scaffold(
// // appBar: const MIHAppBar(

View File

@@ -416,6 +416,8 @@ class _PatientManagerState extends State<PatientManager> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
// return Scaffold(
// // appBar: const MIHAppBar(

View File

@@ -180,6 +180,8 @@ class _PatientViewState extends State<PatientView> {
actionButton: getActionButton(),
header: getHeader(),
body: getBody(),
rightDrawer: null,
bottomNavBar: null,
);
// return Scaffold(
// body: SafeArea(

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.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/patient_add.dart';
import 'package:patient_manager/mih_packages/patient_profile/patient_edit.dart';
@@ -44,7 +45,10 @@ class RouteGenerator {
settings: settings, builder: (_) => const ForgotPassword());
//http://mzansi-innovation-hub.co.za/auth/reset-password
//===============================================================
//Home v2
case '/homev2':
return MaterialPageRoute(
settings: settings, builder: (_) => const MIHProfileGetter());
//About MIH
case '/about':
return MaterialPageRoute(