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,
);
}
}