From f8f367baf6a7e8015ee72023e45ef439237c0d5e Mon Sep 17 00:00:00 2001 From: AN12345 Date: Tue, 13 Dec 2022 18:50:47 -0500 Subject: [PATCH] (feat): rething conception and add missing layouts (close #97) --- .../wyatt_bloc_layout/example/lib/main.dart | 4 +- .../wyatt_bloc_layout/lib/src/core/core.dart | 17 ++ .../crud_cubit_consumer_screen_mixin.dart} | 22 +-- ...app_bar_layout_cubit_consumer_screen.dart} | 37 ++-- .../presentation/consumers/bases/bases.dart | 19 ++ ...tom_bar_layout_cubit_consumer_screen.dart} | 35 +--- .../frame_layout_cubit_consumer_screen.dart} | 44 ++--- .../src/presentation/consumers/consumers.dart | 18 ++ ...ar_layout_crud_cubit_consumer_screen.dart} | 50 +++-- ...bar_layout_crud_cubit_consumer_screen.dart | 47 +++++ .../src/presentation/consumers/crud/crud.dart | 20 ++ .../crud/crud_cubit_consumer_screen.dart | 40 ++++ ...ame_layout_crud_cubit_consumer_screen.dart | 53 +++++ .../crud_cubit_consumer_screen_bases.dart | 61 ------ .../lib/src/presentation/presentation.dart | 10 +- .../bases/app_bar_layout_cubit_screen.dart} | 37 ++-- .../src/presentation/screens/bases/bases.dart | 19 ++ .../bottom_bar_layout_cubit_screen.dart} | 34 +--- .../bases/frame_layout_cubit_screen.dart | 43 +++++ .../app_bar_layout_crud_cubit_screen.dart | 51 +++++ .../bottom_bar_layout_crud_cubit_screen.dart | 47 +++++ .../src/presentation/screens/crud/crud.dart | 20 ++ .../screens/crud/crud_cubit_screen.dart | 39 ++++ .../crud/frame_layout_crud_cubit_screen.dart | 53 +++++ .../lib/src/presentation/screens/screens.dart | 18 ++ packages/wyatt_bloc_layout/lib/src/src.dart | 1 + .../models/class-models.puml | 181 ++++++++++++++++++ 27 files changed, 776 insertions(+), 244 deletions(-) create mode 100644 packages/wyatt_bloc_layout/lib/src/core/core.dart rename packages/wyatt_bloc_layout/lib/src/{presentation/screens/crud_cubit_screen_base.dart => core/crud_cubit_consumer_screen_mixin.dart} (70%) rename packages/wyatt_bloc_layout/lib/src/presentation/{screens/app_bar_cubit_screen.dart => consumers/bases/app_bar_layout_cubit_consumer_screen.dart} (63%) create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/bases.dart rename packages/wyatt_bloc_layout/lib/src/presentation/{screens/bottom_navigation_bar_layout_crud_screen.dart => consumers/bases/bottom_bar_layout_cubit_consumer_screen.dart} (60%) rename packages/wyatt_bloc_layout/lib/src/presentation/{screens/frame_layout_crud_screen.dart => consumers/bases/frame_layout_cubit_consumer_screen.dart} (58%) create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/consumers/consumers.dart rename packages/wyatt_bloc_layout/lib/src/presentation/consumers/{frame_layout_crud_consumer_screen.dart => crud/app_bar_layout_crud_cubit_consumer_screen.dart} (50%) create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/bottom_bar_layout_crud_cubit_consumer_screen.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud_cubit_consumer_screen.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/frame_layout_crud_cubit_consumer_screen.dart delete mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud_cubit_consumer_screen_bases.dart rename packages/wyatt_bloc_layout/lib/src/presentation/{consumers/app_bar_cubit_consumer_screen.dart => screens/bases/app_bar_layout_cubit_screen.dart} (61%) create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/bases.dart rename packages/wyatt_bloc_layout/lib/src/presentation/{consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart => screens/bases/bottom_bar_layout_cubit_screen.dart} (58%) create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/frame_layout_cubit_screen.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/app_bar_layout_crud_cubit_screen.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/bottom_bar_layout_crud_cubit_screen.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud_cubit_screen.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/frame_layout_crud_cubit_screen.dart create mode 100644 packages/wyatt_bloc_layout/lib/src/presentation/screens/screens.dart create mode 100644 packages/wyatt_bloc_layout/models/class-models.puml diff --git a/packages/wyatt_bloc_layout/example/lib/main.dart b/packages/wyatt_bloc_layout/example/lib/main.dart index eafe4286..cbe743c0 100644 --- a/packages/wyatt_bloc_layout/example/lib/main.dart +++ b/packages/wyatt_bloc_layout/example/lib/main.dart @@ -105,7 +105,7 @@ class ExampleListCrudStateManagement } class ExampleFrameLayoutCrudConsumer - extends FrameLayoutCrudConsumerScreen { + extends FrameLayoutCrudCubitConsumerScreen { const ExampleFrameLayoutCrudConsumer() : super( title: 'Example Title', @@ -118,7 +118,7 @@ class ExampleFrameLayoutCrudConsumer } class ExampleFrameLayoutCrudListConsumer - extends FrameLayoutCrudListConsumerScreen { + extends FrameLayoutCrudListCubitConsumerScreen { const ExampleFrameLayoutCrudListConsumer() : super( title: 'Example Title', diff --git a/packages/wyatt_bloc_layout/lib/src/core/core.dart b/packages/wyatt_bloc_layout/lib/src/core/core.dart new file mode 100644 index 00000000..e215b540 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/core/core.dart @@ -0,0 +1,17 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export './crud_cubit_consumer_screen_mixin.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud_cubit_screen_base.dart b/packages/wyatt_bloc_layout/lib/src/core/crud_cubit_consumer_screen_mixin.dart similarity index 70% rename from packages/wyatt_bloc_layout/lib/src/presentation/screens/crud_cubit_screen_base.dart rename to packages/wyatt_bloc_layout/lib/src/core/crud_cubit_consumer_screen_mixin.dart index 04f35bbf..1f62595a 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud_cubit_screen_base.dart +++ b/packages/wyatt_bloc_layout/lib/src/core/crud_cubit_consumer_screen_mixin.dart @@ -16,11 +16,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; -import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; -abstract class CrudCubitScreenBase, - SuccessState extends CrudSuccess> extends CubitScreen { - const CrudCubitScreenBase(); +import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart'; +import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; + +mixin CrudMixin { Widget errorBuilder(BuildContext context, CrudError state) => context.components.errorWidget?.configure(error: state.message) ?? const SizedBox.shrink(); @@ -33,8 +34,7 @@ abstract class CrudCubitScreenBase, Widget successBuilder(BuildContext context, SuccessState state); - @override - Widget onBuild(BuildContext context, CrudState state) => + Widget crudBuilder(BuildContext context, CrudState state) => CrudBuilder( errorBuilder: errorBuilder, loadingBuilder: loadingBuilder, @@ -43,13 +43,3 @@ abstract class CrudCubitScreenBase, builder: successBuilder, ); } - -abstract class CrudCubitScreen, T> - extends CrudCubitScreenBase> { - const CrudCubitScreen(); -} - -abstract class CrudListCubitScreen, T> - extends CrudCubitScreenBase> { - const CrudListCubitScreen(); -} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/app_bar_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/app_bar_layout_cubit_consumer_screen.dart similarity index 63% rename from packages/wyatt_bloc_layout/lib/src/presentation/screens/app_bar_cubit_screen.dart rename to packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/app_bar_layout_cubit_consumer_screen.dart index 4715a8b9..d12706cd 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/screens/app_bar_cubit_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/app_bar_layout_cubit_consumer_screen.dart @@ -16,37 +16,26 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; -abstract class AppBarLayoutCrudScreen, - T> extends CrudCubitScreen { - final String? title; - - const AppBarLayoutCrudScreen({ +abstract class AppBarLayoutCubitConsumerScreen< + Cubit extends bloc_base.Cubit, + State extends Object> extends CubitConsumerScreen { + const AppBarLayoutCubitConsumerScreen({ this.title, + this.leading, + this.actions, + super.key, }); + final String? title; + final Widget? leading; + final List? actions; + @override Widget parent(BuildContext context, Widget child) => AppBarLayout( - title: title ?? 'Title', - body: child, - ); -} - -abstract class AppBarLayoutCrudListScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudListCubitScreen { - final String? title; - final int? currentIndex; - - const AppBarLayoutCrudListScreen({ - this.title, - this.currentIndex, - }); - - @override - Widget parent(BuildContext context, Widget child) => AppBarLayout( - title: title ?? 'Title', + title: title, body: child, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/bases.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/bases.dart new file mode 100644 index 00000000..08af9be8 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/bases.dart @@ -0,0 +1,19 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export './app_bar_layout_cubit_consumer_screen.dart'; +export './bottom_bar_layout_cubit_consumer_screen.dart'; +export './frame_layout_cubit_consumer_screen.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/bottom_navigation_bar_layout_crud_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/bottom_bar_layout_cubit_consumer_screen.dart similarity index 60% rename from packages/wyatt_bloc_layout/lib/src/presentation/screens/bottom_navigation_bar_layout_crud_screen.dart rename to packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/bottom_bar_layout_cubit_consumer_screen.dart index 28724729..0b2cab99 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/screens/bottom_navigation_bar_layout_crud_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/bottom_bar_layout_cubit_consumer_screen.dart @@ -16,40 +16,23 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; -abstract class BottomNavigationBarLayoutCrudScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudCubitScreen { - final int? currentIndex; - - const BottomNavigationBarLayoutCrudScreen({ +abstract class BottomBarLayoutCubitConsumerScreen< + Cubit extends bloc_base.Cubit, + State extends Object> extends CubitConsumerScreen { + const BottomBarLayoutCubitConsumerScreen({ this.currentIndex, + super.key, }); + final int? currentIndex; + @override Widget parent(BuildContext context, Widget child) => BottomNavigationBarLayout( + currentIndex: currentIndex, body: child, - currentIndex: currentIndex ?? 0, - ); -} - -abstract class BottomNavigationBarLayoutCrudListScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudListCubitScreen { - final String? title; - final int? currentIndex; - - const BottomNavigationBarLayoutCrudListScreen({ - this.title, - this.currentIndex, - }); - - @override - Widget parent(BuildContext context, Widget child) => - BottomNavigationBarLayout( - body: child, - currentIndex: currentIndex ?? 0, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/frame_layout_crud_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/frame_layout_cubit_consumer_screen.dart similarity index 58% rename from packages/wyatt_bloc_layout/lib/src/presentation/screens/frame_layout_crud_screen.dart rename to packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/frame_layout_cubit_consumer_screen.dart index 8403be7a..71a5e661 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/screens/frame_layout_crud_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bases/frame_layout_cubit_consumer_screen.dart @@ -14,43 +14,31 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; -abstract class FrameLayoutCrudScreen, - T> extends CrudCubitScreen { - final String? title; - final int? currentIndex; - - const FrameLayoutCrudScreen({ +abstract class FrameLayoutCubitConsumerScreen< + Cubit extends bloc_base.Cubit, + State extends Object> extends CubitConsumerScreen { + const FrameLayoutCubitConsumerScreen({ this.title, + this.leading, + this.actions, this.currentIndex, + super.key, }); + final int? currentIndex; + final String? title; + final Widget? leading; + final List? actions; + @override Widget parent(BuildContext context, Widget child) => FrameLayout( - title: title ?? 'Title', + title: title, + currentIndex: currentIndex, body: child, - currentIndex: currentIndex ?? 0, - ); -} - -abstract class FrameLayoutCrudListScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudListCubitScreen { - final String? title; - final int? currentIndex; - - const FrameLayoutCrudListScreen({ - this.title, - this.currentIndex, - }); - - @override - Widget parent(BuildContext context, Widget child) => FrameLayout( - title: title ?? 'Title', - body: child, - currentIndex: currentIndex ?? 0, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/consumers.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/consumers.dart new file mode 100644 index 00000000..7cac2b7f --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/consumers.dart @@ -0,0 +1,18 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export 'bases/bases.dart'; +export 'crud/crud.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/frame_layout_crud_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/app_bar_layout_crud_cubit_consumer_screen.dart similarity index 50% rename from packages/wyatt_bloc_layout/lib/src/presentation/consumers/frame_layout_crud_consumer_screen.dart rename to packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/app_bar_layout_crud_cubit_consumer_screen.dart index cb4d1ba6..89b36987 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/frame_layout_crud_consumer_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/app_bar_layout_crud_cubit_consumer_screen.dart @@ -18,40 +18,34 @@ import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; -abstract class FrameLayoutCrudConsumerScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudCubitConsumerScreen { - final String? title; - final int? currentIndex; - - const FrameLayoutCrudConsumerScreen({ - this.title, - this.currentIndex, +abstract class AppBarLayoutCrudCubitConsumerScreen< + Cubit extends bloc_base.Cubit, T extends Object> + extends AppBarLayoutCubitConsumerScreen + with CrudMixin> { + const AppBarLayoutCrudCubitConsumerScreen({ + super.title, + super.leading, + super.actions, + super.key, }); @override - Widget parent(BuildContext context, Widget child) => FrameLayout( - title: title ?? 'Title', - body: child, - currentIndex: currentIndex ?? 0, - ); + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); } -abstract class FrameLayoutCrudListConsumerScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudListCubitConsumerScreen { - final String? title; - final int? currentIndex; - - const FrameLayoutCrudListConsumerScreen({ - this.title, - this.currentIndex, +abstract class AppBarLayoutCrudListCubitConsumerScreen< + Cubit extends bloc_base.Cubit, T extends Object> + extends AppBarLayoutCubitConsumerScreen + with CrudMixin> { + const AppBarLayoutCrudListCubitConsumerScreen({ + super.title, + super.leading, + super.actions, + super.key, }); @override - Widget parent(BuildContext context, Widget child) => FrameLayout( - title: title ?? 'Title', - body: child, - currentIndex: currentIndex ?? 0, - ); + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/bottom_bar_layout_crud_cubit_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/bottom_bar_layout_crud_cubit_consumer_screen.dart new file mode 100644 index 00000000..06e86bb1 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/bottom_bar_layout_crud_cubit_consumer_screen.dart @@ -0,0 +1,47 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; + +abstract class BottomBarLayoutCrudCubitConsumerScreen< + Cubit extends bloc_base.Cubit, T extends Object> + extends BottomBarLayoutCubitConsumerScreen + with CrudMixin> { + const BottomBarLayoutCrudCubitConsumerScreen({ + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} + +abstract class BottomBarLayoutCrudListCubitConsumerScreen< + Cubit extends bloc_base.Cubit, T extends Object> + extends BottomBarLayoutCubitConsumerScreen + with CrudMixin> { + const BottomBarLayoutCrudListCubitConsumerScreen({ + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud.dart new file mode 100644 index 00000000..0b3f1bee --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud.dart @@ -0,0 +1,20 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export './app_bar_layout_crud_cubit_consumer_screen.dart'; +export './bottom_bar_layout_crud_cubit_consumer_screen.dart'; +export './frame_layout_crud_cubit_consumer_screen.dart'; +export './crud_cubit_consumer_screen.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud_cubit_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud_cubit_consumer_screen.dart new file mode 100644 index 00000000..c3dd9782 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud_cubit_consumer_screen.dart @@ -0,0 +1,40 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + +abstract class CrudCubitConsumerScreen, + T extends Object> extends CubitConsumerScreen + with CrudMixin> { + const CrudCubitConsumerScreen({super.key}); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} + +abstract class CrudListCubitConsumerScreen< + Cubit extends bloc_base.Cubit, + T extends Object> extends CubitConsumerScreen + with CrudMixin> { + const CrudListCubitConsumerScreen({super.key}); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/frame_layout_crud_cubit_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/frame_layout_crud_cubit_consumer_screen.dart new file mode 100644 index 00000000..204d1cd2 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/frame_layout_crud_cubit_consumer_screen.dart @@ -0,0 +1,53 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; + +abstract class FrameLayoutCrudCubitConsumerScreen< + Cubit extends bloc_base.Cubit, T extends Object> + extends FrameLayoutCubitConsumerScreen + with CrudMixin> { + const FrameLayoutCrudCubitConsumerScreen({ + super.title, + super.leading, + super.actions, + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} + +abstract class FrameLayoutCrudListCubitConsumerScreen< + Cubit extends bloc_base.Cubit, T extends Object> + extends FrameLayoutCubitConsumerScreen + with CrudMixin> { + const FrameLayoutCrudListCubitConsumerScreen({ + super.title, + super.leading, + super.actions, + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud_cubit_consumer_screen_bases.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud_cubit_consumer_screen_bases.dart deleted file mode 100644 index e3f58686..00000000 --- a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud_cubit_consumer_screen_bases.dart +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2022 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; -import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; -import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart'; -import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; - -abstract class CrudCubitConsumerScreenBase< - Cubit extends bloc_base.Cubit, - SuccessState extends CrudSuccess> - extends CubitConsumerScreen { - const CrudCubitConsumerScreenBase({super.key}); - - Widget errorBuilder(BuildContext context, CrudError state) => - context.components.errorWidget?.configure(error: state.message) ?? - const SizedBox.shrink(); - - Widget loadingBuilder(BuildContext context, CrudLoading state) => - context.components.loadingWidget ?? const SizedBox.shrink(); - - Widget initialBuilder(BuildContext context, CrudInitial state) => - const SizedBox.shrink(); - - Widget successBuilder(BuildContext context, SuccessState state); - - @override - Widget onBuild(BuildContext context, CrudState state) => - CrudBuilder( - errorBuilder: errorBuilder, - loadingBuilder: loadingBuilder, - initialBuilder: initialBuilder, - state: state, - builder: successBuilder, - ); -} - -abstract class CrudCubitConsumerScreen, - T> extends CrudCubitConsumerScreenBase> { - const CrudCubitConsumerScreen(); -} - -abstract class CrudListCubitConsumerScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudCubitConsumerScreenBase> { - const CrudListCubitConsumerScreen(); -} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart b/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart index ccd4538b..f5c14cde 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart @@ -14,11 +14,5 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -export 'consumers/crud_cubit_consumer_screen_bases.dart'; -export 'consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart'; -export 'consumers/app_bar_cubit_consumer_screen.dart'; -export 'consumers/frame_layout_crud_consumer_screen.dart'; -export 'screens/crud_cubit_screen_base.dart'; -export 'screens/app_bar_cubit_screen.dart'; -export 'screens/bottom_navigation_bar_layout_crud_screen.dart'; -export 'screens/frame_layout_crud_screen.dart'; +export 'consumers/consumers.dart'; +export 'screens/screens.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/app_bar_cubit_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/app_bar_layout_cubit_screen.dart similarity index 61% rename from packages/wyatt_bloc_layout/lib/src/presentation/consumers/app_bar_cubit_consumer_screen.dart rename to packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/app_bar_layout_cubit_screen.dart index 252ec6b8..ce82fccb 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/app_bar_cubit_consumer_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/app_bar_layout_cubit_screen.dart @@ -16,38 +16,25 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; -abstract class AppBarLayoutCrudConsumerScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudCubitConsumerScreen { - final String? title; - - const AppBarLayoutCrudConsumerScreen({ +abstract class AppBarLayoutCubitScreen, + State extends Object> extends CubitScreen { + const AppBarLayoutCubitScreen({ this.title, + this.leading, + this.actions, + super.key, }); + final String? title; + final Widget? leading; + final List? actions; + @override Widget parent(BuildContext context, Widget child) => AppBarLayout( - title: title ?? 'Title', - body: child, - ); -} - -abstract class AppBarLayoutCrudListConsumerScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudListCubitConsumerScreen { - final String? title; - final int? currentIndex; - - const AppBarLayoutCrudListConsumerScreen({ - this.title, - this.currentIndex, - }); - - @override - Widget parent(BuildContext context, Widget child) => AppBarLayout( - title: title ?? 'Title', + title: title, body: child, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/bases.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/bases.dart new file mode 100644 index 00000000..1b44493c --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/bases.dart @@ -0,0 +1,19 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export 'app_bar_layout_cubit_screen.dart'; +export 'bottom_bar_layout_cubit_screen.dart'; +export 'frame_layout_cubit_screen.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/bottom_bar_layout_cubit_screen.dart similarity index 58% rename from packages/wyatt_bloc_layout/lib/src/presentation/consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart rename to packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/bottom_bar_layout_cubit_screen.dart index 354fca83..d864dbab 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/bottom_bar_layout_cubit_screen.dart @@ -16,40 +16,22 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; -abstract class BottomNavigationBarLayoutCrudConsumerScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudCubitConsumerScreen { - final int? currentIndex; - - const BottomNavigationBarLayoutCrudConsumerScreen({ +abstract class BottomBarLayoutCubitScreen, + State extends Object> extends CubitScreen { + const BottomBarLayoutCubitScreen({ this.currentIndex, + super.key, }); + final int? currentIndex; + @override Widget parent(BuildContext context, Widget child) => BottomNavigationBarLayout( + currentIndex: currentIndex, body: child, - currentIndex: currentIndex ?? 0, - ); -} - -abstract class BottomNavigationBarLayoutCrudListConsumerScreen< - Cubit extends bloc_base.Cubit, - T> extends CrudListCubitConsumerScreen { - final String? title; - final int? currentIndex; - - const BottomNavigationBarLayoutCrudListConsumerScreen({ - this.title, - this.currentIndex, - }); - - @override - Widget parent(BuildContext context, Widget child) => - BottomNavigationBarLayout( - body: child, - currentIndex: currentIndex ?? 0, ); } diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/frame_layout_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/frame_layout_cubit_screen.dart new file mode 100644 index 00000000..769664a2 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bases/frame_layout_cubit_screen.dart @@ -0,0 +1,43 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; + +abstract class FrameLayoutCubitScreen, + State extends Object> extends CubitScreen { + const FrameLayoutCubitScreen({ + this.title, + this.leading, + this.actions, + this.currentIndex, + super.key, + }); + + final int? currentIndex; + final String? title; + final Widget? leading; + final List? actions; + + @override + Widget parent(BuildContext context, Widget child) => FrameLayout( + title: title, + currentIndex: currentIndex, + body: child, + ); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/app_bar_layout_crud_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/app_bar_layout_crud_cubit_screen.dart new file mode 100644 index 00000000..f82fb7a1 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/app_bar_layout_crud_cubit_screen.dart @@ -0,0 +1,51 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; + +abstract class AppBarLayoutCrudCubitScreen< + Cubit extends bloc_base.Cubit, + T extends Object> extends AppBarLayoutCubitScreen + with CrudMixin> { + const AppBarLayoutCrudCubitScreen({ + super.title, + super.leading, + super.actions, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} + +abstract class AppBarLayoutCrudListCubitScreen< + Cubit extends bloc_base.Cubit, + T extends Object> extends AppBarLayoutCubitScreen + with CrudMixin> { + const AppBarLayoutCrudListCubitScreen({ + super.title, + super.leading, + super.actions, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/bottom_bar_layout_crud_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/bottom_bar_layout_crud_cubit_screen.dart new file mode 100644 index 00000000..73c0f59e --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/bottom_bar_layout_crud_cubit_screen.dart @@ -0,0 +1,47 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; + +abstract class BottomBarLayoutCrudCubitScreen< + Cubit extends bloc_base.Cubit, + T extends Object> extends BottomBarLayoutCubitScreen + with CrudMixin> { + const BottomBarLayoutCrudCubitScreen({ + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} + +abstract class BottomBarLayoutCrudListCubitScreen< + Cubit extends bloc_base.Cubit, + T extends Object> extends BottomBarLayoutCubitScreen + with CrudMixin> { + const BottomBarLayoutCrudListCubitScreen({ + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud.dart new file mode 100644 index 00000000..1b71aa69 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud.dart @@ -0,0 +1,20 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export 'app_bar_layout_crud_cubit_screen.dart'; +export 'bottom_bar_layout_crud_cubit_screen.dart'; +export 'frame_layout_crud_cubit_screen.dart'; +export './crud_cubit_screen.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud_cubit_screen.dart new file mode 100644 index 00000000..00b95866 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud_cubit_screen.dart @@ -0,0 +1,39 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; + +abstract class CrudCubitScreen, + T extends Object> extends CubitScreen + with CrudMixin> { + const CrudCubitScreen({super.key}); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} + +abstract class CrudListCubitScreen, + T extends Object> extends CubitScreen + with CrudMixin> { + const CrudListCubitScreen({super.key}); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/frame_layout_crud_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/frame_layout_crud_cubit_screen.dart new file mode 100644 index 00000000..736e8696 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/frame_layout_crud_cubit_screen.dart @@ -0,0 +1,53 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; + +abstract class FrameLayoutCrudCubitScreen< + Cubit extends bloc_base.Cubit, + T extends Object> extends FrameLayoutCubitScreen + with CrudMixin> { + const FrameLayoutCrudCubitScreen({ + super.title, + super.leading, + super.actions, + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} + +abstract class FrameLayoutCrudListCubitScreen< + Cubit extends bloc_base.Cubit, + T extends Object> extends FrameLayoutCubitScreen + with CrudMixin> { + const FrameLayoutCrudListCubitScreen({ + super.title, + super.leading, + super.actions, + super.currentIndex, + super.key, + }); + + @override + Widget onBuild(BuildContext context, CrudState state) => + crudBuilder(context, state); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/screens.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/screens.dart new file mode 100644 index 00000000..57ee4935 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/screens.dart @@ -0,0 +1,18 @@ +// Copyright (C) 2022 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +export './bases/bases.dart'; +export './crud/crud.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/src.dart b/packages/wyatt_bloc_layout/lib/src/src.dart index e23b026c..1bc39e49 100644 --- a/packages/wyatt_bloc_layout/lib/src/src.dart +++ b/packages/wyatt_bloc_layout/lib/src/src.dart @@ -15,6 +15,7 @@ // along with this program. If not, see . export 'presentation/presentation.dart'; +export 'core/core.dart'; export 'package:flutter_bloc/flutter_bloc.dart'; export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; diff --git a/packages/wyatt_bloc_layout/models/class-models.puml b/packages/wyatt_bloc_layout/models/class-models.puml new file mode 100644 index 00000000..3a557834 --- /dev/null +++ b/packages/wyatt_bloc_layout/models/class-models.puml @@ -0,0 +1,181 @@ +@startuml +set namespaceSeparator :: + +abstract class "wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" { + +Widget errorBuilder() + +Widget loadingBuilder() + +Widget initialBuilder() + +Widget successBuilder() + +Widget crudBuilder() +} + +abstract class "wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" { + +int? currentIndex + +Widget parent() +} + +"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" { + +String? title + +Widget? leading + +List? actions + +Widget parent() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" o-- "flutter::src::widgets::framework.dart::Widget" +"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" { + +int? currentIndex + +String? title + +Widget? leading + +List? actions + +Widget parent() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" o-- "flutter::src::widgets::framework.dart::Widget" +"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" { + +int? currentIndex + +Widget parent() +} + +"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" { + +String? title + +Widget? leading + +List? actions + +Widget parent() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" o-- "flutter::src::widgets::framework.dart::Widget" +"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" { + +int? currentIndex + +String? title + +Widget? leading + +List? actions + +Widget parent() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" o-- "flutter::src::widgets::framework.dart::Widget" +"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen" + +abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen" { + +Widget onBuild() +} + +"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen" +"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen" + + +@enduml \ No newline at end of file