update layout builder

This commit is contained in:
2024-10-01 12:37:57 +02:00
parent ef78fd581f
commit da4851b6f3
6 changed files with 49 additions and 25 deletions

View File

@@ -28,17 +28,11 @@ class _MIHActionState extends State<MIHAction> {
@override
Widget build(BuildContext context) {
return Positioned(
top: 5,
left: 5,
width: 50,
height: 50,
child: IconButton(
iconSize: widget.iconSize,
padding: const EdgeInsets.all(0),
onPressed: widget.onTap,
icon: widget.icon,
),
return IconButton(
iconSize: widget.iconSize,
padding: const EdgeInsets.all(0),
onPressed: widget.onTap,
icon: widget.icon,
);
}
}

View File

@@ -27,7 +27,7 @@ class _MIHHeaderState extends State<MIHHeader> {
@override
Widget build(BuildContext context) {
return SizedBox(
height: 60,
height: 50,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: widget.headerAlignment,

View File

@@ -41,6 +41,24 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
// _scaffoldKey.currentState!.openEndDrawer();
// }
Widget getLayoutHeader() {
List<Widget> temp = [];
temp.add(widget.actionButton);
temp.add(Flexible(child: widget.header));
if (widget.secondaryActionButton != null) {
temp.add(widget.secondaryActionButton!);
} else {
temp.add(const SizedBox(
width: 50,
));
}
return Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: temp,
);
}
@override
void dispose() {
super.dispose();
@@ -62,17 +80,11 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
child: SizedBox(
width: screenSize.width,
height: screenSize.height,
child: Stack(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Builder(builder: (context) {
return widget.actionButton;
}),
Column(
children: [
widget.header,
Expanded(child: widget.body),
],
),
getLayoutHeader(),
Expanded(child: widget.body),
],
),
),

View File

@@ -231,7 +231,13 @@ class _RegisterState extends State<Register> {
MIHAction getActionButton() {
return MIHAction(
icon: Image.asset('images/logo_light.png'),
icon: Padding(
padding: const EdgeInsets.all(10.0),
child: SizedBox(
height: 50,
child: Image.asset('images/logo_light.png'),
),
),
iconSize: 35,
onTap: () {
Navigator.of(context).pushNamed(

View File

@@ -258,7 +258,13 @@ class _ResetPasswordState extends State<ResetPassword> {
MIHAction getActionButton() {
return MIHAction(
icon: Image.asset('images/logo_light.png'),
icon: Padding(
padding: const EdgeInsets.all(10.0),
child: SizedBox(
height: 50,
child: Image.asset('images/logo_light.png'),
),
),
iconSize: 35,
onTap: () {
// Navigator.of(context).pushNamed(

View File

@@ -262,7 +262,13 @@ class _SignInState extends State<SignIn> {
MIHAction getActionButton() {
return MIHAction(
icon: Image.asset('images/logo_light.png'),
icon: Padding(
padding: const EdgeInsets.all(10.0),
child: SizedBox(
height: 50,
child: Image.asset('images/logo_light.png'),
),
),
iconSize: 35,
onTap: () {
Navigator.of(context).pushNamed(