forked from yaso_meth/mih-project
update layout builder
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user