fix: make components nullable
continuous-integration/drone/pr Build is passing

This commit is contained in:
2023-08-30 14:00:46 +02:00
parent 5a7b8bf958
commit 84a6705446
2 changed files with 104 additions and 14 deletions
@@ -76,29 +76,37 @@ class FrameLayout extends StructuralLayout {
final ScaffoldFieldsWrapper? scaffoldFieldsWrapper;
PreferredSize? _buildAppBar(BuildContext context) {
final appBar = customAppBar?.call(
context.components.topAppBarComponentOrNull(appBarId)?.call(),
) ??
context.components.topAppBarComponentOrNull(appBarId)?.call();
return appBar != null
? PreferredSize(
preferredSize: Size.fromHeight(height),
child: appBar,
)
: null;
}
@override
Widget build(BuildContext context) => Scaffold(
appBar: (customAppBar
?.call(context.components.topAppBarComponent(appBarId)()) !=
null)
? PreferredSize(
preferredSize: Size.fromHeight(height),
child: customAppBar?.call(
context.components.topAppBarComponent(appBarId)(),
) ??
context.components.topAppBarComponent(appBarId)(),
)
: null,
appBar: _buildAppBar(context),
floatingActionButton: customFloatingActionButton?.call(
context.components
.floatingActionButtonComponent(floatingActionButtonId)(),
.floatingActionButtonComponentOrNull(floatingActionButtonId)
?.call(),
) ??
context.components
.floatingActionButtonComponent(floatingActionButtonId)(),
.floatingActionButtonComponentOrNull(floatingActionButtonId)
?.call(),
bottomNavigationBar: customBottomNavBar?.call(
context.components.bottomNavigationBarComponent(bottomNavBarId)(),
) ??
context.components.bottomNavigationBarComponent(bottomNavBarId)(),
context.components
.bottomNavigationBarComponentOrNull(bottomNavBarId)
?.call(),
body: body,
floatingActionButtonLocation:
scaffoldFieldsWrapper?.floatingActionButtonLocation,