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/consumers/app_bar_cubit_consumer_screen.dart new file mode 100644 index 00000000..d18bd7eb --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/app_bar_cubit_consumer_screen.dart @@ -0,0 +1,54 @@ +// 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'; +import 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart'; + +abstract class AppBarLayoutCrudConsumerScreen< + Cubit extends bloc_base.Cubit, + T> extends CrudCubitConsumerScreen { + final String? title; + + const AppBarLayoutCrudConsumerScreen({ + this.title, + }); + + @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', + body: child, + ); +} 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/consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart new file mode 100644 index 00000000..170c0094 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart @@ -0,0 +1,56 @@ +// 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'; +import 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart'; + +abstract class BottomNavigationBarLayoutCrudConsumerScreen< + Cubit extends bloc_base.Cubit, + T> extends CrudCubitConsumerScreen { + final int? currentIndex; + + const BottomNavigationBarLayoutCrudConsumerScreen({ + this.currentIndex, + }); + + @override + Widget parent(BuildContext context, Widget child) => + BottomNavigationBarLayout( + 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/consumers/frame_layout_crud_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/frame_layout_crud_consumer_screen copy.dart similarity index 100% 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/frame_layout_crud_consumer_screen copy.dart diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart b/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart index f0d2c69e..acd00814 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/presentation.dart @@ -15,8 +15,13 @@ // along with this program. If not, see . export 'consumers/crud_cubit_consumer_screen_bases.dart'; -export 'consumers/frame_layout_crud_consumer_screen.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 copy.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 'package:flutter_bloc/flutter_bloc.dart'; export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/app_bar_cubit_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/app_bar_cubit_screen.dart new file mode 100644 index 00000000..e86d95fa --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/app_bar_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'; +import 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart'; + +abstract class AppBarLayoutCrudScreen, + T> extends CrudCubitScreen { + final String? title; + + const AppBarLayoutCrudScreen({ + this.title, + }); + + @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', + body: child, + ); +} 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/screens/bottom_navigation_bar_layout_crud_screen.dart new file mode 100644 index 00000000..79503f09 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/bottom_navigation_bar_layout_crud_screen.dart @@ -0,0 +1,56 @@ +// 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'; +import 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart'; + +abstract class BottomNavigationBarLayoutCrudScreen< + Cubit extends bloc_base.Cubit, + T> extends CrudCubitScreen { + final int? currentIndex; + + const BottomNavigationBarLayoutCrudScreen({ + this.currentIndex, + }); + + @override + Widget parent(BuildContext context, Widget child) => + BottomNavigationBarLayout( + 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/crud_cubit_screen_base.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud_cubit_screen_base.dart index 08fd4e78..4240f819 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud_cubit_screen_base.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud_cubit_screen_base.dart @@ -21,6 +21,7 @@ import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; abstract class CrudCubitScreenBase, SuccessState extends CrudSuccess> extends CubitScreen { + const CrudCubitScreenBase(); Widget errorBuilder(BuildContext context, CrudError state) => context.components.errorWidget; @@ -44,7 +45,11 @@ abstract class CrudCubitScreenBase, } abstract class CrudCubitScreen, T> - extends CrudCubitScreenBase> {} + extends CrudCubitScreenBase> { + const CrudCubitScreen(); +} abstract class CrudListCubitScreen, T> - extends CrudCubitScreenBase> {} + extends CrudCubitScreenBase> { + const CrudListCubitScreen(); +} diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/screens/frame_layout_crud_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/screens/frame_layout_crud_screen.dart new file mode 100644 index 00000000..458e6801 --- /dev/null +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/frame_layout_crud_screen.dart @@ -0,0 +1,57 @@ +// 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/src/widgets/framework.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; +import 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart'; + +abstract class FrameLayoutCrudScreen, + T> extends CrudCubitScreen { + final String? title; + final int? currentIndex; + + const FrameLayoutCrudScreen({ + this.title, + this.currentIndex, + }); + + @override + Widget parent(BuildContext context, Widget child) => FrameLayout( + title: title ?? 'Title', + 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, + ); +}