refactor(ui_layout): update package using nullable component data (#92)

This commit is contained in:
AN12345 2022-12-12 14:14:15 -05:00
parent 7a24a36af0
commit e01f47d41a
3 changed files with 6 additions and 4 deletions

View File

@ -31,7 +31,8 @@ class AppBarLayout extends Layout {
Widget build(BuildContext context) => Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(60),
child: context.components.appBar.configure(title: title),
child: context.components.appBar?.configure(title: title) ??
const SizedBox.shrink(),
),
body: body,
);

View File

@ -14,7 +14,7 @@ class BottomNavigationBarLayout extends Layout {
@override
Widget build(BuildContext context) => Scaffold(
body: body,
bottomNavigationBar: context.components.bottomNavigationBar.configure(
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
currentIndex: currentIndex,
),
);

View File

@ -34,10 +34,11 @@ class FrameLayout extends Layout {
Widget build(BuildContext context) => Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(60),
child: context.components.appBar.configure(title: title),
child: context.components.appBar?.configure(title: title) ??
const SizedBox.shrink(),
),
body: body,
bottomNavigationBar: context.components.bottomNavigationBar.configure(
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
currentIndex: currentIndex,
),
);