diff --git a/packages/wyatt_bloc_layout/example/lib/components/theme_components.dart b/packages/wyatt_bloc_layout/example/lib/components/theme_components.dart index 888522dd..0be4d529 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/theme_components.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/theme_components.dart @@ -5,10 +5,10 @@ import 'package:bloc_layout_example/components/custom_loading_widget.dart'; import 'package:wyatt_ui_components/wyatt_ui_components.dart'; abstract class AppThemeComponent { - static const ComponentThemeData components = ComponentThemeData.raw( - topAppBar: CustomAppBar(), - bottomNavigationBar: CustomBottomBar(), - loader: CustomLoadingWidget(), - error: CustomErrorWidget(), + static ComponentThemeData components = ComponentThemeData.raw( + topAppBars: const CustomAppBar().registry(), + bottomNavigationBars: const CustomBottomBar().registry(), + loaders: const CustomLoadingWidget().registry(), + errors: const CustomErrorWidget().registry(), ); } diff --git a/packages/wyatt_bloc_layout/lib/src/core/crud_cubit_consumer_screen_mixin.dart b/packages/wyatt_bloc_layout/lib/src/core/crud_cubit_consumer_screen_mixin.dart index 7a083f3c..79e5f00d 100644 --- a/packages/wyatt_bloc_layout/lib/src/core/crud_cubit_consumer_screen_mixin.dart +++ b/packages/wyatt_bloc_layout/lib/src/core/crud_cubit_consumer_screen_mixin.dart @@ -23,12 +23,13 @@ import 'package:wyatt_ui_components/wyatt_ui_components.dart'; mixin CrudMixin, SuccessState extends CrudSuccess> { Widget errorBuilder(BuildContext context, CrudError state) => - context.components.errorComponent.call( - message: (state.message != null) ? TextWrapper(state.message!) : null, - ); + context.components.errorComponent().call( + message: + (state.message != null) ? TextWrapper(state.message!) : null, + ); Widget loadingBuilder(BuildContext context, CrudLoading state) => - context.components.loader ?? const SizedBox.shrink(); + context.components.loaderComponent()(); Widget initialBuilder(BuildContext context, CrudInitial state) => const SizedBox.shrink(); diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_grid_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_grid_layout_cubit_screen_crud_list.dart index 952a2c81..3bef8e64 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_grid_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_grid_layout_cubit_screen_crud_list.dart @@ -24,7 +24,8 @@ abstract class BottomNavigationBarGridLayoutCubitScreenCrudList< with GridLayoutMixin { const BottomNavigationBarGridLayoutCubitScreenCrudList({ super.custom, - super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen.dart index 0a02294f..ed0c7a82 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen.dart @@ -26,18 +26,21 @@ abstract class BottomNavigationBarLayoutCubitScreen< State extends Object> extends CubitScreenBase { const BottomNavigationBarLayoutCubitScreen({ this.custom, - this.height = 60, + this.barId, + this.scaffoldFieldsWrapper, super.key, }); - final double height; - final BottomNavigationBarComponent? Function(BottomNavigationBarComponent?)? - custom; + final ComponentCallBack? custom; + final ScaffoldFieldsWrapper? scaffoldFieldsWrapper; + final String? barId; @override Widget parent(BuildContext context, Widget child) => - BottomNavigationBarLayout( + StructuralLayout.withBottomNavBar( custom: custom, + barId: barId, + scaffoldFieldsWrapper: scaffoldFieldsWrapper, body: child, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud.dart b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud.dart index c1cc938d..f6fcbad6 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud.dart @@ -26,7 +26,8 @@ abstract class BottomNavigationBarLayoutCubitScreenCrud< with CrudMixin { const BottomNavigationBarLayoutCubitScreenCrud({ super.custom, - super.height, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_item.dart b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_item.dart index 69ff4371..aa65e30a 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_item.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_item.dart @@ -24,7 +24,8 @@ abstract class BottomNavigationBarLayoutCubitScreenCrudItem< CrudLoaded> { const BottomNavigationBarLayoutCubitScreenCrudItem({ super.custom, - super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_list.dart index 7c6c5b21..2d884bfa 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud_list.dart @@ -24,7 +24,8 @@ abstract class BottomNavigationBarLayoutCubitScreenCrudList< CrudListLoaded> { const BottomNavigationBarLayoutCubitScreenCrudList({ super.custom, - super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_grid_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_grid_layout_cubit_screen_crud_list.dart index 044776d5..162464dc 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_grid_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_grid_layout_cubit_screen_crud_list.dart @@ -25,7 +25,11 @@ abstract class FrameLayoutGridCubitScreenCrudList< const FrameLayoutGridCubitScreenCrudList({ super.customAppBar, super.customBottomNavBar, - super.height = 60, + super.floatingActionButtonId, + super.height, + super.appBarId, + super.bottomNavBarId, + super.customFloatingActionButton, super.scaffoldFieldsWrapper, super.key, }); diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen.dart index d5b6d415..2adc78c2 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen.dart @@ -26,21 +26,34 @@ abstract class FrameLayoutCubitScreen, const FrameLayoutCubitScreen({ this.customAppBar, this.customBottomNavBar, + this.customFloatingActionButton, + this.appBarId, + this.bottomNavBarId, + this.floatingActionButtonId, this.scaffoldFieldsWrapper, this.height = 60, super.key, }); - final TopAppBarComponent? Function(TopAppBarComponent?)? customAppBar; - final BottomNavigationBarComponent? Function(BottomNavigationBarComponent?)? - customBottomNavBar; + final ComponentCallBack? customAppBar; + final ComponentCallBack? customBottomNavBar; + final ComponentCallBack? + customFloatingActionButton; + final String? appBarId; + final String? bottomNavBarId; + final String? floatingActionButtonId; final double height; final ScaffoldFieldsWrapper? scaffoldFieldsWrapper; @override - Widget parent(BuildContext context, Widget child) => FrameLayout( + Widget parent(BuildContext context, Widget child) => + StructuralLayout.withFrame( customAppBar: customAppBar, customBottomNavBar: customBottomNavBar, + customFloatingActionButton: customFloatingActionButton, + appBarId: appBarId, + bottomNavBarId: bottomNavBarId, + floatingActionButtonId: floatingActionButtonId, height: height, scaffoldFieldsWrapper: scaffoldFieldsWrapper, body: child, diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud.dart b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud.dart index 0803c37e..f29a6afd 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud.dart @@ -27,9 +27,13 @@ abstract class FrameLayoutCubitScreenCrud< const FrameLayoutCubitScreenCrud({ super.customAppBar, super.customBottomNavBar, + super.floatingActionButtonId, super.height, - super.key, + super.appBarId, + super.bottomNavBarId, + super.customFloatingActionButton, super.scaffoldFieldsWrapper, + super.key, }); @override diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_item.dart b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_item.dart index e3d9e965..ec3b37a4 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_item.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_item.dart @@ -24,7 +24,11 @@ abstract class FrameLayoutCubitScreenCrudItem< const FrameLayoutCubitScreenCrudItem({ super.customAppBar, super.customBottomNavBar, - super.height = 60, + super.floatingActionButtonId, + super.height, + super.appBarId, + super.bottomNavBarId, + super.customFloatingActionButton, super.scaffoldFieldsWrapper, super.key, }); diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_list.dart index 7ff1910b..e6831695 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/frame_bloc_layout/frame_layout_cubit_screen_crud_list.dart @@ -24,7 +24,11 @@ abstract class FrameLayoutCubitScreenCrudList< const FrameLayoutCubitScreenCrudList({ super.customAppBar, super.customBottomNavBar, - super.height = 60, + super.floatingActionButtonId, + super.height, + super.appBarId, + super.bottomNavBarId, + super.customFloatingActionButton, super.scaffoldFieldsWrapper, super.key, }); diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/structural_bloc_layout.dart b/packages/wyatt_bloc_layout/lib/src/presentation/structural_bloc_layout.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/structural_bloc_layout.dart @@ -0,0 +1 @@ + diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_grid_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_grid_layout_cubit_screen_crud_list.dart index e20a1842..d0bfcd07 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_grid_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_grid_layout_cubit_screen_crud_list.dart @@ -25,6 +25,8 @@ abstract class TopAppBarGridLayoutCubitScreenCrudList< const TopAppBarGridLayoutCubitScreenCrudList({ super.custom, super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen.dart index 48fe0abe..4f79e518 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen.dart @@ -25,17 +25,23 @@ abstract class TopAppBarLayoutCubitScreen, State extends Object> extends CubitScreenBase { const TopAppBarLayoutCubitScreen({ this.custom, + this.barId, + this.scaffoldFieldsWrapper, this.height = 60, super.key, }); final double height; - final TopAppBarComponent? Function(TopAppBarComponent?)? custom; + final ComponentCallBack? custom; + final String? barId; + final ScaffoldFieldsWrapper? scaffoldFieldsWrapper; @override Widget parent(BuildContext context, Widget child) => TopAppBarLayout( height: height, custom: custom, + barId: barId, + scaffoldFieldsWrapper: scaffoldFieldsWrapper, body: child, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud.dart index efa82d3e..9a15513e 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud.dart @@ -27,6 +27,8 @@ abstract class TopAppBarLayoutCubitScreenCrud< const TopAppBarLayoutCubitScreenCrud({ super.custom, super.height, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_item.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_item.dart index dd7e2bb1..9011b564 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_item.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_item.dart @@ -24,6 +24,8 @@ abstract class TopAppBarLayoutCubitScreenCrudItem< const TopAppBarLayoutCubitScreenCrudItem({ super.custom, super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_list.dart index 902ce24c..e4b36161 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud_list.dart @@ -24,6 +24,8 @@ abstract class TopAppBarLayoutCubitScreenCrudList< const TopAppBarLayoutCubitScreenCrudList({ super.custom, super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_grid_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_grid_layout_cubit_screen_crud_list.dart index b57d29cf..ff8f6bb8 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_grid_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_grid_layout_cubit_screen_crud_list.dart @@ -25,6 +25,8 @@ abstract class TopNavigationBarGridLayoutCubitScreenCrudList< const TopNavigationBarGridLayoutCubitScreenCrudList({ super.custom, super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen.dart index b1903cdc..71352ce3 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen.dart @@ -27,16 +27,23 @@ abstract class TopNavigationBarLayoutCubitScreen< const TopNavigationBarLayoutCubitScreen({ this.custom, this.height = 60, + this.barId, + this.scaffoldFieldsWrapper, super.key, }); final double height; - final TopNavigationBarComponent? Function(TopNavigationBarComponent?)? custom; + final ComponentCallBack? custom; + final String? barId; + final ScaffoldFieldsWrapper? scaffoldFieldsWrapper; @override - Widget parent(BuildContext context, Widget child) => TopNavigationBarLayout( - height: height, + Widget parent(BuildContext context, Widget child) => + StructuralLayout.withTopNavigationBar( + barId: barId, custom: custom, + height: height, + scaffoldFieldsWrapper: scaffoldFieldsWrapper, body: child, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud.dart index 76bd6beb..4de19691 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud.dart @@ -27,6 +27,8 @@ abstract class TopNavigationBarLayoutCubitScreenCrud< const TopNavigationBarLayoutCubitScreenCrud({ super.custom, super.height, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_item.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_item.dart index 112b8844..d1fce340 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_item.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_item.dart @@ -25,6 +25,8 @@ abstract class TopNavigationBarLayoutCubitScreenCrudItem< const TopNavigationBarLayoutCubitScreenCrudItem({ super.custom, super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_list.dart b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_list.dart index 0f17b282..092fee71 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_list.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud_list.dart @@ -25,6 +25,8 @@ abstract class TopNavigationBarLayoutCubitScreenCrudList< const TopNavigationBarLayoutCubitScreenCrudList({ super.custom, super.height = 60, + super.barId, + super.scaffoldFieldsWrapper, super.key, }); }