refactor(ui_layout): migrate layouts using copywith component method (#116)

This commit is contained in:
2023-02-07 10:49:09 +01:00
parent ff3f2008de
commit 413589462b
4 changed files with 7 additions and 12 deletions
@@ -35,7 +35,7 @@ class AppBarLayout extends Layout {
Widget build(BuildContext context) => Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(60),
child: context.components.appBar?.configure(
child: context.components.appBar?.copyWith(
title: title,
leading: leading,
actions: actions,
@@ -13,7 +13,7 @@ class BottomNavigationBarLayout extends Layout {
@override
Widget build(BuildContext context) => Scaffold(
body: body,
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
bottomNavigationBar: context.components.bottomNavigationBar?.copyWith(
currentIndex: currentIndex ?? 0,
),
);
@@ -37,7 +37,7 @@ class FrameLayout extends Layout {
Widget build(BuildContext context) => Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(60),
child: context.components.appBar?.configure(
child: context.components.appBar?.copyWith(
title: title,
leading: leading,
actions: actions,
@@ -45,7 +45,7 @@ class FrameLayout extends Layout {
const SizedBox.shrink(),
),
body: body,
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
bottomNavigationBar: context.components.bottomNavigationBar?.copyWith(
currentIndex: currentIndex ?? 0,
),
);