From 8d833d39d7f0da4cde74852f8f6257348c2cdc76 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Thu, 23 Feb 2023 19:19:48 +0100 Subject: [PATCH] chore: fix and format using melos --- melos.yaml | 14 +- .../lib/data/models/list_photo_model.dart | 1 - .../repositories/photo_repository_impl.dart | 1 - .../local/favorite_local_data_source.dart | 6 +- .../remote/album_remote_data_source.dart | 6 +- .../remote/photo_remote_data_source.dart | 6 +- .../photos/add_photo_to_favorites.dart | 1 - .../check_if_photo_is_in_favorites.dart | 1 - .../usecases/photos/display_favorites.dart | 1 - .../domain/usecases/photos/display_photo.dart | 1 - .../domain/usecases/photos/open_album.dart | 1 - .../photos/params/query_parameters.dart | 1 - .../photos/remove_photo_from_favorites.dart | 1 - .../usecases/photos/retrieve_all_albums.dart | 1 - .../albums/blocs/album/album_bloc.dart | 1 - .../state_management/widgets/albums_list.dart | 7 +- .../photo_details/photo_details_state.dart | 2 - .../favorite_checker_cubit.dart | 1 - .../favorite_checker_state.dart | 2 - .../photos/blocs/photo/photo_bloc.dart | 1 - .../photos/blocs/photo/photo_event.dart | 1 - .../state_management/widgets/photos_grid.dart | 26 ++-- .../widgets/photos_grid_thumbnail.dart | 5 +- .../lib/src/core/exceptions/exceptions.dart | 1 - .../domain/data_sources/base_data_source.dart | 6 +- .../src/domain/data_sources/data_sources.dart | 6 +- .../local/base_local_data_source.dart | 6 +- .../src/domain/data_sources/local/local.dart | 6 +- .../remote/base_remote_data_source.dart | 6 +- .../domain/data_sources/remote/remote.dart | 6 +- .../lib/src/domain/entities/entities.dart | 6 +- .../lib/src/domain/entities/entity.dart | 6 +- .../src/domain/repositories/repositories.dart | 6 +- packages/wyatt_architecture/lib/src/src.dart | 6 +- .../email_verification_cubit_test.dart | 4 +- .../password_reset_cubit_test.dart | 4 +- .../test/sign_in/sign_in_cubit_test.dart | 4 +- .../test/sign_up/sign_up_cubit_test.dart | 4 +- .../lib/counter/bloc/counter_bloc.dart | 7 +- .../lib/counter/bloc/counter_event.dart | 6 +- .../lib/counter/bloc/counter_state.dart | 7 +- .../lib/counter/counter_bloc_page.dart | 6 +- .../lib/counter/counter_consumer_page.dart | 3 +- .../lib/counter/counter_cubit_page.dart | 17 +-- .../lib/counter/counter_provider_page.dart | 2 +- .../lib/counter/cubit/counter_state.dart | 7 +- .../example/lib/counter_observer.dart | 8 +- .../example/lib/main_page.dart | 3 +- .../src/mixins/bloc_base_provider_mixin.dart | 2 +- .../lib/src/mixins/bloc_provider_mixin.dart | 2 +- .../lib/src/widgets/multi_provider.dart | 6 +- .../wyatt_bloc_layout/analysis_options.yaml | 6 +- .../example/lib/bloc/example_cubit.dart | 20 +-- .../lib/components/custom_app_bar.dart | 2 +- .../lib/components/custom_bottom_bar.dart | 22 +-- .../lib/components/custom_error_widget.dart | 2 +- .../lib/components/custom_loading_widget.dart | 2 +- .../lib/components/theme_components.dart | 4 +- .../wyatt_bloc_layout/example/lib/main.dart | 100 ++++++------- .../example/test/widget_test.dart | 2 +- .../crud_cubit_consumer_screen_mixin.dart | 2 +- ...bar_layout_crud_cubit_consumer_screen.dart | 2 +- .../src/presentation/consumers/crud/crud.dart | 2 +- .../crud/crud_cubit_consumer_screen.dart | 2 +- .../src/presentation/screens/crud/crud.dart | 2 +- .../screens/crud/crud_cubit_screen.dart | 2 +- packages/wyatt_bloc_layout/lib/src/src.dart | 12 +- packages/wyatt_bloc_layout/pubspec.yaml | 13 +- .../analysis_options.yaml | 6 - .../pubspec.yaml | 2 + packages/wyatt_crud_bloc/example/lib/app.dart | 5 +- .../example/lib/app_bloc_observer.dart | 6 +- .../example/test/widget_test.dart | 1 + .../wyatt_crud_bloc/lib/src/data/data.dart | 6 +- .../crud_in_memory_data_source_impl.dart | 1 - .../crud_firestore_data_source_impl.dart | 1 - .../repositories/crud_repository_impl.dart | 1 - .../src/data/repositories/repositories.dart | 6 +- .../src/domain/data_sources/data_sources.dart | 6 +- .../lib/src/domain/domain.dart | 6 +- .../lib/src/domain/entities/entities.dart | 6 +- .../lib/src/domain/entities/query.dart | 3 - .../src/domain/repositories/repositories.dart | 6 +- .../lib/src/domain/usecases/delete.dart | 1 - .../lib/src/domain/usecases/delete_all.dart | 1 - .../lib/src/domain/usecases/get.dart | 1 - .../lib/src/domain/usecases/get_all.dart | 1 - .../src/domain/usecases/params/params.dart | 6 +- .../usecases/params/stream_parameters.dart | 2 +- .../usecases/params/update_parameters.dart | 2 +- .../lib/src/domain/usecases/query.dart | 1 - .../lib/src/domain/usecases/stream_query.dart | 10 +- .../lib/src/domain/usecases/update.dart | 1 - .../lib/src/domain/usecases/update_all.dart | 1 - .../lib/src/domain/usecases/usecases.dart | 6 +- .../src/features/crud/builder/builder.dart | 6 +- .../src/features/crud/cubit/crud_cubit.dart | 1 - .../src/features/crud/cubit/crud_state.dart | 3 - .../lib/src/features/features.dart | 6 +- .../wyatt_form_bloc/example/lib/app/app.dart | 6 +- .../example/lib/app/metadata.dart | 5 +- .../example/lib/constants.dart | 8 +- .../lib/sign_up/widgets/sign_up_form.dart | 3 +- .../example/test/widget_test.dart | 1 + .../lib/src/core/enums/set_operations.dart | 4 +- .../lib/src/core/enums/validation_error.dart | 6 +- .../lib/src/data/form/wyatt_form_impl.dart | 3 +- .../src/data/input_validators/boolean.dart | 6 +- .../data/input_validators/enum_option.dart | 3 +- .../lib/src/domain/entities/form_input.dart | 3 +- .../features/form_data/form_data_state.dart | 2 +- .../form_data_impl/form_data_cubit_impl.dart | 1 - .../example/http_client_fastapi_example.dart | 133 +++++++++--------- .../lib/src/middleware_client.dart | 1 - .../access_token_auth_middleware.dart | 7 +- .../middlewares/basic_auth_middleware.dart | 1 - .../middlewares/digest_auth_middleware.dart | 1 - .../lib/src/middlewares/middlewares.dart | 6 +- .../refresh_token_auth_middleware.dart | 1 - .../middlewares/unsafe_auth_middleware.dart | 1 - .../middlewares/uri_prefix_middleware.dart | 1 - .../lib/src/models/middleware_context.dart | 22 +-- .../lib/src/models/middleware_response.dart | 11 +- .../lib/src/models/models.dart | 6 +- .../lib/src/models/unfreezed_request.dart | 18 +-- .../wyatt_http_client/lib/src/pipeline.dart | 4 +- .../lib/src/utils/convert.dart | 10 +- .../lib/src/utils/digest_auth.dart | 3 +- .../lib/src/utils/http_methods.dart | 4 +- .../lib/src/utils/http_status.dart | 11 +- .../lib/src/utils/utils.dart | 6 +- .../example/lib/main.dart | 2 +- .../lib/src/wyatt_notification_bloc_base.dart | 2 - .../wyatt_type_utils/example/lib/error.dart | 1 - .../wyatt_type_utils/example/lib/todo.dart | 2 +- .../lib/src/either/option.dart | 15 +- .../lib/src/either/result.dart | 2 - .../src/extensions/iterable_extension.dart | 2 +- .../lib/src/extensions/string_extension.dart | 2 +- .../wyatt_type_utils/lib/src/pair/pair.dart | 1 - .../wyatt_type_utils/test/result_test.dart | 6 +- .../entities/loader/loader_component.dart | 2 +- .../rich_text_builder_component.dart | 2 +- .../lib/src/features/component_theme.dart | 1 - .../example/test/widget_test.dart | 1 + .../file_selection_button_theme_resolver.dart | 1 - .../flat_button/flat_button_screen.dart | 1 + .../symbol_button_theme_resolver.dart | 1 - .../components/cards/widgets/card_text.dart | 2 +- .../src/components/gradients/gradients.dart | 6 +- .../features/wyatt_component_theme_data.dart | 8 +- packages/wyatt_ui_layout/pubspec.yaml | 2 + 152 files changed, 441 insertions(+), 468 deletions(-) diff --git a/melos.yaml b/melos.yaml index 3430ffd7..627be29e 100644 --- a/melos.yaml +++ b/melos.yaml @@ -24,13 +24,17 @@ scripts: melos exec -c 1 -- flutter analyze --fatal-infos description: Run `flutter analyze` for all packages. - format: - run: melos exec flutter format . --fix - description: Run `flutter format` for all packages. + fix: + run: melos exec dart fix . --apply + description: Run `dart fix` for all packages. + format: + run: melos exec dart format . + description: Run `dart format` for all packages. + format-check: - run: melos exec flutter format . --set-exit-if-changed - description: Run `flutter format` checks for all packages. + run: melos exec dart fix . --set-exit-if-changed + description: Run `dart fix` checks for all packages. clean:deep: run: git clean -x -d -f -q diff --git a/packages/wyatt_architecture/example/lib/data/models/list_photo_model.dart b/packages/wyatt_architecture/example/lib/data/models/list_photo_model.dart index 1112389a..38350986 100644 --- a/packages/wyatt_architecture/example/lib/data/models/list_photo_model.dart +++ b/packages/wyatt_architecture/example/lib/data/models/list_photo_model.dart @@ -15,7 +15,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . - import 'package:architecture_example/data/models/photo_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; diff --git a/packages/wyatt_architecture/example/lib/data/repositories/photo_repository_impl.dart b/packages/wyatt_architecture/example/lib/data/repositories/photo_repository_impl.dart index d30d74ba..d7a5aaf3 100644 --- a/packages/wyatt_architecture/example/lib/data/repositories/photo_repository_impl.dart +++ b/packages/wyatt_architecture/example/lib/data/repositories/photo_repository_impl.dart @@ -24,7 +24,6 @@ import 'package:wyatt_architecture/wyatt_architecture.dart'; import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class PhotoRepositoryImpl extends PhotoRepository { - PhotoRepositoryImpl( this._photoRemoteDataSource, this._albumRemoteDataSource, diff --git a/packages/wyatt_architecture/example/lib/domain/data_sources/local/favorite_local_data_source.dart b/packages/wyatt_architecture/example/lib/domain/data_sources/local/favorite_local_data_source.dart index c9b06187..587a99ee 100644 --- a/packages/wyatt_architecture/example/lib/domain/data_sources/local/favorite_local_data_source.dart +++ b/packages/wyatt_architecture/example/lib/domain/data_sources/local/favorite_local_data_source.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/example/lib/domain/data_sources/remote/album_remote_data_source.dart b/packages/wyatt_architecture/example/lib/domain/data_sources/remote/album_remote_data_source.dart index 996f76b2..fbef7f9a 100644 --- a/packages/wyatt_architecture/example/lib/domain/data_sources/remote/album_remote_data_source.dart +++ b/packages/wyatt_architecture/example/lib/domain/data_sources/remote/album_remote_data_source.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/example/lib/domain/data_sources/remote/photo_remote_data_source.dart b/packages/wyatt_architecture/example/lib/domain/data_sources/remote/photo_remote_data_source.dart index 5b1d79a9..81d03a9a 100644 --- a/packages/wyatt_architecture/example/lib/domain/data_sources/remote/photo_remote_data_source.dart +++ b/packages/wyatt_architecture/example/lib/domain/data_sources/remote/photo_remote_data_source.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/add_photo_to_favorites.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/add_photo_to_favorites.dart index f84969a3..769ae81d 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/add_photo_to_favorites.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/add_photo_to_favorites.dart @@ -21,7 +21,6 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart'; import 'package:wyatt_architecture/wyatt_architecture.dart'; class AddPhotoToFavorites extends AsyncUseCase> { - AddPhotoToFavorites(this._photoRepository); final PhotoRepository _photoRepository; diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/check_if_photo_is_in_favorites.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/check_if_photo_is_in_favorites.dart index d208f554..7ff464ce 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/check_if_photo_is_in_favorites.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/check_if_photo_is_in_favorites.dart @@ -20,7 +20,6 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart'; import 'package:wyatt_architecture/wyatt_architecture.dart'; class CheckIfPhotoIsInFavorites extends AsyncUseCase { - CheckIfPhotoIsInFavorites(this._photoRepository); final PhotoRepository _photoRepository; diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_favorites.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_favorites.dart index 4d7bb3d9..8bdf027f 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_favorites.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_favorites.dart @@ -19,7 +19,6 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart'; import 'package:wyatt_architecture/wyatt_architecture.dart'; class DisplayFavorites extends AsyncUseCase> { - DisplayFavorites(this._photoRepository); final PhotoRepository _photoRepository; diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_photo.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_photo.dart index 82b3ecce..36076c70 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_photo.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/display_photo.dart @@ -21,7 +21,6 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart'; import 'package:wyatt_architecture/wyatt_architecture.dart'; class DisplayPhoto extends AsyncUseCase { - DisplayPhoto(this._photoRepository); final PhotoRepository _photoRepository; diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/open_album.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/open_album.dart index ca59d1b5..8badf689 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/open_album.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/open_album.dart @@ -22,7 +22,6 @@ import 'package:architecture_example/domain/usecases/photos/params/query_paramet import 'package:wyatt_architecture/wyatt_architecture.dart'; class OpenAlbum extends AsyncUseCase> { - OpenAlbum(this._photoRepository); final PhotoRepository _photoRepository; diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/params/query_parameters.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/params/query_parameters.dart index 525dd438..4ac96e8e 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/params/query_parameters.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/params/query_parameters.dart @@ -15,7 +15,6 @@ // along with this program. If not, see . class QueryParameters { - QueryParameters(this.start, this.limit, {this.albumId = -1}); final int albumId; final int? start; diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/remove_photo_from_favorites.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/remove_photo_from_favorites.dart index 9e361137..737c59a1 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/remove_photo_from_favorites.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/remove_photo_from_favorites.dart @@ -21,7 +21,6 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart'; import 'package:wyatt_architecture/wyatt_architecture.dart'; class RemovePhotoFromFavorites extends AsyncUseCase> { - RemovePhotoFromFavorites(this._photoRepository); final PhotoRepository _photoRepository; diff --git a/packages/wyatt_architecture/example/lib/domain/usecases/photos/retrieve_all_albums.dart b/packages/wyatt_architecture/example/lib/domain/usecases/photos/retrieve_all_albums.dart index 286de15b..0fc6a757 100644 --- a/packages/wyatt_architecture/example/lib/domain/usecases/photos/retrieve_all_albums.dart +++ b/packages/wyatt_architecture/example/lib/domain/usecases/photos/retrieve_all_albums.dart @@ -22,7 +22,6 @@ import 'package:architecture_example/domain/usecases/photos/params/query_paramet import 'package:wyatt_architecture/wyatt_architecture.dart'; class RetrieveAllAlbums extends AsyncUseCase> { - RetrieveAllAlbums(this._photoRepository); final PhotoRepository _photoRepository; diff --git a/packages/wyatt_architecture/example/lib/presentation/features/albums/blocs/album/album_bloc.dart b/packages/wyatt_architecture/example/lib/presentation/features/albums/blocs/album/album_bloc.dart index ae79c30d..896a06dd 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/albums/blocs/album/album_bloc.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/albums/blocs/album/album_bloc.dart @@ -33,7 +33,6 @@ EventTransformer throttleDroppable(Duration duration) => (events, mapper) => droppable().call(events.throttle(duration), mapper); class AlbumBloc extends Bloc { - AlbumBloc(this._retrieveAllAlbums) : super(const AlbumState()) { on( _onAlbumFetched, diff --git a/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/widgets/albums_list.dart b/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/widgets/albums_list.dart index 82af8ecd..5e2db9f6 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/widgets/albums_list.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/widgets/albums_list.dart @@ -22,8 +22,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class AlbumsList extends StatefulWidget { - const AlbumsList( - {required this.albums, required this.hasReachedMax, super.key,}); + const AlbumsList({ + required this.albums, + required this.hasReachedMax, + super.key, + }); final List albums; final bool hasReachedMax; diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photo_details/blocs/photo_details/photo_details_state.dart b/packages/wyatt_architecture/example/lib/presentation/features/photo_details/blocs/photo_details/photo_details_state.dart index c8da9232..980678c0 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photo_details/blocs/photo_details/photo_details_state.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photo_details/blocs/photo_details/photo_details_state.dart @@ -26,7 +26,6 @@ abstract class PhotoDetailsState extends Equatable { class PhotoDetailsInitial extends PhotoDetailsState {} class PhotoDetailsSuccess extends PhotoDetailsState { - const PhotoDetailsSuccess(this.photo, {required this.isFavorite}); final Photo photo; final bool isFavorite; @@ -36,7 +35,6 @@ class PhotoDetailsSuccess extends PhotoDetailsState { } class PhotoDetailsFailure extends PhotoDetailsState { - const PhotoDetailsFailure(this.error); final String error; diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_cubit.dart b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_cubit.dart index 1a15f123..7999f3a4 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_cubit.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_cubit.dart @@ -23,7 +23,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; part 'favorite_checker_state.dart'; class FavoriteCheckerCubit extends Cubit { - FavoriteCheckerCubit(this._checkIfPhotoIsInFavorites) : super(FavoriteCheckerInitial()); final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites; diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_state.dart b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_state.dart index ca762080..08a58826 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_state.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/favorite_checker/favorite_checker_state.dart @@ -10,7 +10,6 @@ abstract class FavoriteCheckerState extends Equatable { class FavoriteCheckerInitial extends FavoriteCheckerState {} class FavoriteCheckerSuccess extends FavoriteCheckerState { - const FavoriteCheckerSuccess(this.photoId, {required this.isFavorite}); final int photoId; final bool isFavorite; @@ -20,7 +19,6 @@ class FavoriteCheckerSuccess extends FavoriteCheckerState { } class FavoriteCheckerFailure extends FavoriteCheckerState { - const FavoriteCheckerFailure(this.error); final String error; diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_bloc.dart b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_bloc.dart index c82c84c5..a0893eca 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_bloc.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_bloc.dart @@ -33,7 +33,6 @@ EventTransformer throttleDroppable(Duration duration) => (events, mapper) => droppable().call(events.throttle(duration), mapper); class PhotoBloc extends Bloc { - PhotoBloc(this._openAlbum) : super(const PhotoState()) { on( _onPhotoFetched, diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_event.dart b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_event.dart index c9a6bfab..7f52aa44 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_event.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photos/blocs/photo/photo_event.dart @@ -24,7 +24,6 @@ abstract class PhotoEvent extends Equatable { } class PhotoFetched extends PhotoEvent { - const PhotoFetched(this.albumId); final int albumId; } diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid.dart b/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid.dart index 80e6ad99..8f1d125a 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid.dart @@ -71,17 +71,17 @@ class _PhotosGridState extends State { @override Widget build(BuildContext context) => GridView.builder( - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisSpacing: 4, - mainAxisSpacing: 4, - crossAxisCount: 4, - ), - itemCount: widget.hasReachedMax - ? widget.photos.length - : widget.photos.length + 1, - controller: _scrollController, - itemBuilder: (context, index) => index >= widget.photos.length - ? const BottomLoader() - : PhotosGridThumbnail(photo: widget.photos[index]), - ); + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: 4, + mainAxisSpacing: 4, + crossAxisCount: 4, + ), + itemCount: widget.hasReachedMax + ? widget.photos.length + : widget.photos.length + 1, + controller: _scrollController, + itemBuilder: (context, index) => index >= widget.photos.length + ? const BottomLoader() + : PhotosGridThumbnail(photo: widget.photos[index]), + ); } diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid_thumbnail.dart b/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid_thumbnail.dart index ab312ca2..021227ff 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid_thumbnail.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/widgets/photos_grid_thumbnail.dart @@ -55,7 +55,10 @@ class PhotosGridThumbnail ), if (state is FavoriteCheckerSuccess && state.isFavorite) ...[ const Positioned( - bottom: 10, right: 10, child: Icon(Icons.favorite),) + bottom: 10, + right: 10, + child: Icon(Icons.favorite), + ) ] ], ), diff --git a/packages/wyatt_architecture/lib/src/core/exceptions/exceptions.dart b/packages/wyatt_architecture/lib/src/core/exceptions/exceptions.dart index 5f568cd5..3fb15944 100644 --- a/packages/wyatt_architecture/lib/src/core/exceptions/exceptions.dart +++ b/packages/wyatt_architecture/lib/src/core/exceptions/exceptions.dart @@ -17,7 +17,6 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart'; abstract class AppException implements Exception { - AppException([this.message]); final String? message; diff --git a/packages/wyatt_architecture/lib/src/domain/data_sources/base_data_source.dart b/packages/wyatt_architecture/lib/src/domain/data_sources/base_data_source.dart index f6a0688a..5dc243db 100644 --- a/packages/wyatt_architecture/lib/src/domain/data_sources/base_data_source.dart +++ b/packages/wyatt_architecture/lib/src/domain/data_sources/base_data_source.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/data_sources/data_sources.dart b/packages/wyatt_architecture/lib/src/domain/data_sources/data_sources.dart index c226b67b..17ffc5c8 100644 --- a/packages/wyatt_architecture/lib/src/domain/data_sources/data_sources.dart +++ b/packages/wyatt_architecture/lib/src/domain/data_sources/data_sources.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/data_sources/local/base_local_data_source.dart b/packages/wyatt_architecture/lib/src/domain/data_sources/local/base_local_data_source.dart index 820a5fd3..1d7c134c 100644 --- a/packages/wyatt_architecture/lib/src/domain/data_sources/local/base_local_data_source.dart +++ b/packages/wyatt_architecture/lib/src/domain/data_sources/local/base_local_data_source.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/data_sources/local/local.dart b/packages/wyatt_architecture/lib/src/domain/data_sources/local/local.dart index 08fce718..e45c6a57 100644 --- a/packages/wyatt_architecture/lib/src/domain/data_sources/local/local.dart +++ b/packages/wyatt_architecture/lib/src/domain/data_sources/local/local.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/data_sources/remote/base_remote_data_source.dart b/packages/wyatt_architecture/lib/src/domain/data_sources/remote/base_remote_data_source.dart index 08e10d36..a4a72999 100644 --- a/packages/wyatt_architecture/lib/src/domain/data_sources/remote/base_remote_data_source.dart +++ b/packages/wyatt_architecture/lib/src/domain/data_sources/remote/base_remote_data_source.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/data_sources/remote/remote.dart b/packages/wyatt_architecture/lib/src/domain/data_sources/remote/remote.dart index 81d8f125..7403e595 100644 --- a/packages/wyatt_architecture/lib/src/domain/data_sources/remote/remote.dart +++ b/packages/wyatt_architecture/lib/src/domain/data_sources/remote/remote.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/entities/entities.dart b/packages/wyatt_architecture/lib/src/domain/entities/entities.dart index 47ef61fa..937b195e 100644 --- a/packages/wyatt_architecture/lib/src/domain/entities/entities.dart +++ b/packages/wyatt_architecture/lib/src/domain/entities/entities.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/entities/entity.dart b/packages/wyatt_architecture/lib/src/domain/entities/entity.dart index 67df1106..fd988950 100644 --- a/packages/wyatt_architecture/lib/src/domain/entities/entity.dart +++ b/packages/wyatt_architecture/lib/src/domain/entities/entity.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/domain/repositories/repositories.dart b/packages/wyatt_architecture/lib/src/domain/repositories/repositories.dart index bc97c14e..bac1ea4c 100644 --- a/packages/wyatt_architecture/lib/src/domain/repositories/repositories.dart +++ b/packages/wyatt_architecture/lib/src/domain/repositories/repositories.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_architecture/lib/src/src.dart b/packages/wyatt_architecture/lib/src/src.dart index 50ef204e..2a39a026 100644 --- a/packages/wyatt_architecture/lib/src/src.dart +++ b/packages/wyatt_architecture/lib/src/src.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_authentication_bloc/test/email_verification/email_verification_cubit_test.dart b/packages/wyatt_authentication_bloc/test/email_verification/email_verification_cubit_test.dart index e07a4f2d..05ea7a74 100644 --- a/packages/wyatt_authentication_bloc/test/email_verification/email_verification_cubit_test.dart +++ b/packages/wyatt_authentication_bloc/test/email_verification/email_verification_cubit_test.dart @@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class MockAuthenticationRepository extends Mock implements AuthenticationRepository {} -class MockAuthenticationCubit extends Mock implements AuthenticationCubit { -} +class MockAuthenticationCubit extends Mock + implements AuthenticationCubit {} class MockAccount extends Mock implements Account {} diff --git a/packages/wyatt_authentication_bloc/test/password_reset/password_reset_cubit_test.dart b/packages/wyatt_authentication_bloc/test/password_reset/password_reset_cubit_test.dart index e28ecb73..ab37fcd3 100644 --- a/packages/wyatt_authentication_bloc/test/password_reset/password_reset_cubit_test.dart +++ b/packages/wyatt_authentication_bloc/test/password_reset/password_reset_cubit_test.dart @@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class MockAuthenticationRepository extends Mock implements AuthenticationRepository {} -class MockAuthenticationCubit extends Mock implements AuthenticationCubit { -} +class MockAuthenticationCubit extends Mock + implements AuthenticationCubit {} class MockAccount extends Mock implements Account {} diff --git a/packages/wyatt_authentication_bloc/test/sign_in/sign_in_cubit_test.dart b/packages/wyatt_authentication_bloc/test/sign_in/sign_in_cubit_test.dart index d45316ff..622bfb79 100644 --- a/packages/wyatt_authentication_bloc/test/sign_in/sign_in_cubit_test.dart +++ b/packages/wyatt_authentication_bloc/test/sign_in/sign_in_cubit_test.dart @@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class MockAuthenticationRepository extends Mock implements AuthenticationRepository {} -class MockAuthenticationCubit extends Mock implements AuthenticationCubit { -} +class MockAuthenticationCubit extends Mock + implements AuthenticationCubit {} class MockAccount extends Mock implements Account {} diff --git a/packages/wyatt_authentication_bloc/test/sign_up/sign_up_cubit_test.dart b/packages/wyatt_authentication_bloc/test/sign_up/sign_up_cubit_test.dart index 3d54a978..cc966202 100644 --- a/packages/wyatt_authentication_bloc/test/sign_up/sign_up_cubit_test.dart +++ b/packages/wyatt_authentication_bloc/test/sign_up/sign_up_cubit_test.dart @@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class MockAuthenticationRepository extends Mock implements AuthenticationRepository {} -class MockAuthenticationCubit extends Mock implements AuthenticationCubit { -} +class MockAuthenticationCubit extends Mock + implements AuthenticationCubit {} class MockAccount extends Mock implements Account {} diff --git a/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_bloc.dart b/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_bloc.dart index 5bbd3d8e..7c807148 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_bloc.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_bloc.dart @@ -1,16 +1,16 @@ // 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 . @@ -25,7 +25,6 @@ class CounterBloc extends Bloc { final CounterRepository counterRepository; CounterBloc(this.counterRepository) : super(const CounterInitial()) { - on((event, emit) { emit(CounterModified(counterRepository.increment(state.count))); }); diff --git a/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_event.dart b/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_event.dart index c9d38554..53712a48 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_event.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_event.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_state.dart b/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_state.dart index c0179e74..3a92be0f 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_state.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/bloc/counter_state.dart @@ -1,16 +1,16 @@ // 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 . @@ -32,4 +32,3 @@ class CounterInitial extends CounterState { class CounterModified extends CounterState { const CounterModified(super.count); } - diff --git a/packages/wyatt_bloc_helper/example/lib/counter/counter_bloc_page.dart b/packages/wyatt_bloc_helper/example/lib/counter/counter_bloc_page.dart index 2cb6f1d5..de9582da 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/counter_bloc_page.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/counter_bloc_page.dart @@ -24,14 +24,16 @@ class CounterBlocPage const CounterBlocPage({super.key}); @override - CounterBloc create(BuildContext context) => CounterBloc(repo(context)); + CounterBloc create(BuildContext context) => + CounterBloc(repo(context)); @override Widget onBuild(BuildContext context, CounterState state) { final textTheme = Theme.of(context).textTheme; return Scaffold( appBar: AppBar(title: const Text('Counter with Bloc')), - body: Center(child: Text('${state.count}', style: textTheme.headline2)), + body: + Center(child: Text('${state.count}', style: textTheme.displayMedium)), floatingActionButton: Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, diff --git a/packages/wyatt_bloc_helper/example/lib/counter/counter_consumer_page.dart b/packages/wyatt_bloc_helper/example/lib/counter/counter_consumer_page.dart index 9a4a3005..76d426ad 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/counter_consumer_page.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/counter_consumer_page.dart @@ -28,7 +28,8 @@ class CounterConsumerPage final textTheme = Theme.of(context).textTheme; return Scaffold( appBar: AppBar(title: const Text('Counter with Consumer')), - body: Center(child: Text('${state.count}', style: textTheme.headline2)), + body: + Center(child: Text('${state.count}', style: textTheme.displayMedium)), floatingActionButton: Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, diff --git a/packages/wyatt_bloc_helper/example/lib/counter/counter_cubit_page.dart b/packages/wyatt_bloc_helper/example/lib/counter/counter_cubit_page.dart index 5e04d72a..d906c30e 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/counter_cubit_page.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/counter_cubit_page.dart @@ -1,16 +1,16 @@ // 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 . @@ -19,19 +19,20 @@ import 'package:bloc_helper_example/counter/repository/counter_repository.dart'; import 'package:flutter/material.dart'; import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; -class CounterCubitPage - extends CubitScreen { +class CounterCubitPage extends CubitScreen { const CounterCubitPage({super.key}); @override - CounterCubit create(BuildContext context) => CounterCubit(repo(context)); + CounterCubit create(BuildContext context) => + CounterCubit(repo(context)); @override Widget onBuild(BuildContext context, CounterState state) { final textTheme = Theme.of(context).textTheme; return Scaffold( appBar: AppBar(title: const Text('Counter with Cubit')), - body: Center(child: Text('${state.count}', style: textTheme.headline2)), + body: + Center(child: Text('${state.count}', style: textTheme.displayMedium)), floatingActionButton: Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, @@ -53,4 +54,4 @@ class CounterCubitPage ), ); } -} \ No newline at end of file +} diff --git a/packages/wyatt_bloc_helper/example/lib/counter/counter_provider_page.dart b/packages/wyatt_bloc_helper/example/lib/counter/counter_provider_page.dart index 7a6c3d8c..4b81135a 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/counter_provider_page.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/counter_provider_page.dart @@ -35,7 +35,7 @@ class CounterProviderPage appBar: AppBar(title: const Text('Counter with Provider')), body: Center(child: BlocBuilder( builder: (context, state) { - return Text('${state.count}', style: textTheme.headline2); + return Text('${state.count}', style: textTheme.displayMedium); }, )), floatingActionButton: Column( diff --git a/packages/wyatt_bloc_helper/example/lib/counter/cubit/counter_state.dart b/packages/wyatt_bloc_helper/example/lib/counter/cubit/counter_state.dart index e1f39749..87e880b8 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter/cubit/counter_state.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter/cubit/counter_state.dart @@ -1,16 +1,16 @@ // 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 . @@ -32,4 +32,3 @@ class CounterInitial extends CounterState { class CounterModified extends CounterState { const CounterModified(super.count); } - diff --git a/packages/wyatt_bloc_helper/example/lib/counter_observer.dart b/packages/wyatt_bloc_helper/example/lib/counter_observer.dart index 8c75491b..26b1784c 100644 --- a/packages/wyatt_bloc_helper/example/lib/counter_observer.dart +++ b/packages/wyatt_bloc_helper/example/lib/counter_observer.dart @@ -1,16 +1,16 @@ // 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 . @@ -23,4 +23,4 @@ class CounterObserver extends BlocObserver { super.onChange(bloc, change); debugPrint('${bloc.runtimeType} $change'); } -} \ No newline at end of file +} diff --git a/packages/wyatt_bloc_helper/example/lib/main_page.dart b/packages/wyatt_bloc_helper/example/lib/main_page.dart index 2a82d039..b68383e3 100644 --- a/packages/wyatt_bloc_helper/example/lib/main_page.dart +++ b/packages/wyatt_bloc_helper/example/lib/main_page.dart @@ -56,7 +56,8 @@ class MainPage extends StatelessWidget { onPressed: () => Navigator.of(context) .push(MaterialPageRoute(builder: (context) { return BlocProvider( - create: (context) => CounterCubit(context.read()), + create: (context) => + CounterCubit(context.read()), child: const CounterConsumerPage(), ); })), diff --git a/packages/wyatt_bloc_helper/lib/src/mixins/bloc_base_provider_mixin.dart b/packages/wyatt_bloc_helper/lib/src/mixins/bloc_base_provider_mixin.dart index 6c2cf006..37b3c524 100644 --- a/packages/wyatt_bloc_helper/lib/src/mixins/bloc_base_provider_mixin.dart +++ b/packages/wyatt_bloc_helper/lib/src/mixins/bloc_base_provider_mixin.dart @@ -25,7 +25,7 @@ mixin BlocBaseProviderMixin> { /// Returns another [BlocBase] **not** used by this [BlocBaseProviderMixin]. /// Short hand for `context.read();` - /// + /// /// To get [BlocBase] used by by this [BlocBaseProviderMixin] see `bloc()` AnotherBloc anotherBloc(BuildContext context) => context.read(); diff --git a/packages/wyatt_bloc_helper/lib/src/mixins/bloc_provider_mixin.dart b/packages/wyatt_bloc_helper/lib/src/mixins/bloc_provider_mixin.dart index 0680a048..dae33c71 100644 --- a/packages/wyatt_bloc_helper/lib/src/mixins/bloc_provider_mixin.dart +++ b/packages/wyatt_bloc_helper/lib/src/mixins/bloc_provider_mixin.dart @@ -21,7 +21,7 @@ import 'package:flutter_bloc/flutter_bloc.dart' as blocbase; /// of helper methods for events. mixin BlocProviderMixin, Event> { /// Add an event to the [Bloc]. - /// + /// /// Short hand for `context.read().add(event)`. void add(BuildContext context, Event event) => context.read().add(event); diff --git a/packages/wyatt_bloc_helper/lib/src/widgets/multi_provider.dart b/packages/wyatt_bloc_helper/lib/src/widgets/multi_provider.dart index f6503928..4cb3c2bf 100644 --- a/packages/wyatt_bloc_helper/lib/src/widgets/multi_provider.dart +++ b/packages/wyatt_bloc_helper/lib/src/widgets/multi_provider.dart @@ -18,14 +18,14 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; /// {@template multi_provider} -/// Merges [MultiRepositoryProvider] and [MultiBlocProvider] widgets into +/// Merges [MultiRepositoryProvider] and [MultiBlocProvider] widgets into /// one widget tree. /// /// [MultiProvider] improves the readability and eliminates the need /// to nest multiple providers. /// /// By using [MultiProvider] we can go from: -/// +/// /// ```dart /// MultiRepositoryProvider( /// providers: [ @@ -69,7 +69,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; /// ) /// ``` /// -/// [MultiProvider] converts the [RepositoryProvider] and [BlocProvider] lists +/// [MultiProvider] converts the [RepositoryProvider] and [BlocProvider] lists /// into a tree of nested provider widgets. /// As a result, the only advantage of using [MultiProvider] is /// improved readability due to the reduction in nesting and boilerplate. diff --git a/packages/wyatt_bloc_layout/analysis_options.yaml b/packages/wyatt_bloc_layout/analysis_options.yaml index 22f1fb8e..90d6bd51 100644 --- a/packages/wyatt_bloc_layout/analysis_options.yaml +++ b/packages/wyatt_bloc_layout/analysis_options.yaml @@ -1,4 +1,4 @@ -# Copyright (C) 2022 WYATT GROUP +# Copyright (C) 2023 WYATT GROUP # Please see the AUTHORS file for details. # # This program is free software: you can redistribute it and/or modify @@ -14,6 +14,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - -include: package:wyatt_analysis/analysis_options.flutter.experimental.yaml - +include: package:wyatt_analysis/analysis_options.flutter.yaml diff --git a/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart b/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart index 02f810db..6ae6a19b 100644 --- a/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart +++ b/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart @@ -10,9 +10,9 @@ class ExampleCubit extends Cubit { await Future.delayed(const Duration(seconds: 1)); emit(CrudLoading()); await Future.delayed(const Duration(seconds: 1)); - emit(CrudError('Cubit Error')); + emit(const CrudError('Cubit Error')); await Future.delayed(const Duration(seconds: 1)); - emit(CrudLoaded('DATA LOADED')); + emit(const CrudLoaded('DATA LOADED')); await Future.delayed(const Duration(seconds: 1)); emit(CrudInitial()); } @@ -23,14 +23,16 @@ class ExampleCubit extends Cubit { await Future.delayed(const Duration(seconds: 1)); emit(CrudLoading()); await Future.delayed(const Duration(seconds: 1)); - emit(CrudError('Cubit Error')); + emit(const CrudError('Cubit Error')); await Future.delayed(const Duration(seconds: 1)); - emit(CrudListLoaded([ - 'DATA LOADED 1', - 'DATA LOADED 2', - 'DATA LOADED 3', - 'DATA LOADED 4' - ])); + emit( + const CrudListLoaded([ + 'DATA LOADED 1', + 'DATA LOADED 2', + 'DATA LOADED 3', + 'DATA LOADED 4' + ]), + ); await Future.delayed(const Duration(seconds: 1)); emit(CrudInitial()); } diff --git a/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart b/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart index 8d57fb2b..aff474a8 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart @@ -7,7 +7,7 @@ part 'custom_app_bar.g.dart'; @ComponentCopyWithExtension() class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin { - const CustomAppBar({super.title}); + const CustomAppBar({super.key, super.title}); @override Widget build(BuildContext context) => AppBar( title: Text(title?.data ?? 'Title'), diff --git a/packages/wyatt_bloc_layout/example/lib/components/custom_bottom_bar.dart b/packages/wyatt_bloc_layout/example/lib/components/custom_bottom_bar.dart index 5d16b5a5..1b094adf 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/custom_bottom_bar.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/custom_bottom_bar.dart @@ -7,19 +7,23 @@ part 'custom_bottom_bar.g.dart'; @ComponentCopyWithExtension() class CustomBottomBar extends BottomNavigationBarComponent with $CustomBottomBarCWMixin { + const CustomBottomBar({super.key}); + @override Widget build(BuildContext context) => BottomNavigationBar( - items: [ + items: const [ BottomNavigationBarItem( - icon: Icon( - Icons.e_mobiledata, - ), - label: 'Icon 1'), + icon: Icon( + Icons.e_mobiledata, + ), + label: 'Icon 1', + ), BottomNavigationBarItem( - icon: Icon( - Icons.do_not_disturb_off, - ), - label: 'Icon 2'), + icon: Icon( + Icons.do_not_disturb_off, + ), + label: 'Icon 2', + ), ], backgroundColor: Colors.blue, ); diff --git a/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart b/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart index 57447de2..77364998 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart @@ -7,7 +7,7 @@ part 'custom_error_widget.g.dart'; @ComponentCopyWithExtension() class CustomErrorWidget extends ErrorWidgetComponent with $CustomErrorWidgetCWMixin { - CustomErrorWidget({super.error}); + CustomErrorWidget({super.key, super.error}); @override Widget build(BuildContext context) => ColoredBox( diff --git a/packages/wyatt_bloc_layout/example/lib/components/custom_loading_widget.dart b/packages/wyatt_bloc_layout/example/lib/components/custom_loading_widget.dart index 9a8cc10e..94517557 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/custom_loading_widget.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/custom_loading_widget.dart @@ -7,7 +7,7 @@ part 'custom_loading_widget.g.dart'; @ComponentCopyWithExtension() class CustomLoadingWidget extends LoadingWidgetComponent with $CustomLoadingWidgetCWMixin { - CustomLoadingWidget({super.color}); + CustomLoadingWidget({super.key, super.color}); @override Widget build(BuildContext context) => 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 6441c0c8..b0b1f404 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/theme_components.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/theme_components.dart @@ -6,8 +6,8 @@ import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; class AppThemeComponent { static ComponentThemeData get components => ComponentThemeData.raw( - appBar: CustomAppBar(), - bottomNavigationBar: CustomBottomBar(), + appBar: const CustomAppBar(), + bottomNavigationBar: const CustomBottomBar(), loadingWidget: CustomLoadingWidget(), errorWidget: CustomErrorWidget(), ); diff --git a/packages/wyatt_bloc_layout/example/lib/main.dart b/packages/wyatt_bloc_layout/example/lib/main.dart index cbe743c0..e5f0207a 100644 --- a/packages/wyatt_bloc_layout/example/lib/main.dart +++ b/packages/wyatt_bloc_layout/example/lib/main.dart @@ -28,61 +28,63 @@ class MyApp extends StatelessWidget { // This widget is the root of your application. @override - Widget build(BuildContext context) { - return ComponentTheme( - componentThemeWidget: AppThemeComponent.components, - child: MaterialApp( - title: 'Bloc Layout Example', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: Scaffold( - body: Column( - children: [ - Expanded( - child: Row( - children: [ - Expanded( - child: BlocProvider( - create: (_) => ExampleCubit()..run(), - child: ExampleCrudStateManagement(), - ), - ), - Expanded( - child: BlocProvider( - create: (_) => ExampleCubit()..runList(), - child: ExampleListCrudStateManagement(), - ), - ), - ], - ), - ), - Expanded( - child: Row( - children: [ - Expanded( - child: BlocProvider( + Widget build(BuildContext context) => ComponentTheme( + componentThemeWidget: AppThemeComponent.components, + child: MaterialApp( + title: 'Bloc Layout Example', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: Scaffold( + body: Column( + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: BlocProvider( create: (_) => ExampleCubit()..run(), - child: ExampleFrameLayoutCrudConsumer()), - ), - Expanded( - child: BlocProvider( + child: const ExampleCrudStateManagement(), + ), + ), + Expanded( + child: BlocProvider( create: (_) => ExampleCubit()..runList(), - child: ExampleFrameLayoutCrudListConsumer()), - ), - ], + child: const ExampleListCrudStateManagement(), + ), + ), + ], + ), ), - ), - ], + Expanded( + child: Row( + children: [ + Expanded( + child: BlocProvider( + create: (_) => ExampleCubit()..run(), + child: const ExampleFrameLayoutCrudConsumer(), + ), + ), + Expanded( + child: BlocProvider( + create: (_) => ExampleCubit()..runList(), + child: const ExampleFrameLayoutCrudListConsumer(), + ), + ), + ], + ), + ), + ], + ), ), ), - ), - ); - } + ); } class ExampleCrudStateManagement extends CrudCubitConsumerScreen { + const ExampleCrudStateManagement({super.key}); + @override Widget initialBuilder(BuildContext context, CrudInitial state) => Container(color: Colors.yellow); @@ -93,6 +95,8 @@ class ExampleCrudStateManagement class ExampleListCrudStateManagement extends CrudListCubitConsumerScreen { + const ExampleListCrudStateManagement({super.key}); + @override Widget initialBuilder(BuildContext context, CrudInitial state) => Container(color: Colors.green); @@ -106,7 +110,7 @@ class ExampleListCrudStateManagement class ExampleFrameLayoutCrudConsumer extends FrameLayoutCrudCubitConsumerScreen { - const ExampleFrameLayoutCrudConsumer() + const ExampleFrameLayoutCrudConsumer({super.key}) : super( title: 'Example Title', currentIndex: 0, @@ -119,7 +123,7 @@ class ExampleFrameLayoutCrudConsumer class ExampleFrameLayoutCrudListConsumer extends FrameLayoutCrudListCubitConsumerScreen { - const ExampleFrameLayoutCrudListConsumer() + const ExampleFrameLayoutCrudListConsumer({super.key}) : super( title: 'Example Title', currentIndex: 0, diff --git a/packages/wyatt_bloc_layout/example/test/widget_test.dart b/packages/wyatt_bloc_layout/example/test/widget_test.dart index 52de7a27..1bb8b149 100644 --- a/packages/wyatt_bloc_layout/example/test/widget_test.dart +++ b/packages/wyatt_bloc_layout/example/test/widget_test.dart @@ -12,4 +12,4 @@ // 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 . \ No newline at end of file +// along with this program. If not, see . 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 62d9ea8b..20880e37 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 @@ -20,7 +20,7 @@ import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart'; import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; -mixin CrudMixin, SuccessState extends CrudSuccess> { Widget errorBuilder(BuildContext context, CrudError state) => context.components.errorWidget?.copyWith(error: state.message.wrap()) ?? diff --git a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/app_bar_layout_crud_cubit_consumer_screen.dart b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/app_bar_layout_crud_cubit_consumer_screen.dart index 61e0bc86..5e16c8b9 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/app_bar_layout_crud_cubit_consumer_screen.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/app_bar_layout_crud_cubit_consumer_screen.dart @@ -14,7 +14,7 @@ // 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/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base; import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; 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 index 0b3f1bee..a444cf2b 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/consumers/crud/crud.dart @@ -16,5 +16,5 @@ 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'; +export './frame_layout_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 index 08597474..9a36e4a8 100644 --- 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 @@ -15,8 +15,8 @@ // 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; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; abstract class CrudCubitConsumerScreen, T extends Object?> extends CubitConsumerScreen 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 index 1b71aa69..40e3aca4 100644 --- a/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud.dart +++ b/packages/wyatt_bloc_layout/lib/src/presentation/screens/crud/crud.dart @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +export './crud_cubit_screen.dart'; 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 index 7c8b8fa1..b256af58 100644 --- 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 @@ -15,8 +15,8 @@ // 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; +import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; abstract class CrudCubitScreen, T extends Object?> extends CubitScreen diff --git a/packages/wyatt_bloc_layout/lib/src/src.dart b/packages/wyatt_bloc_layout/lib/src/src.dart index 1bc39e49..69296b9a 100644 --- a/packages/wyatt_bloc_layout/lib/src/src.dart +++ b/packages/wyatt_bloc_layout/lib/src/src.dart @@ -14,11 +14,11 @@ // You should have received a copy of the GNU General Public License // 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'; -export 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart'; -export 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart'; export 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; +export 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart'; +export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; +export 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart'; + +export 'core/core.dart'; +export 'presentation/presentation.dart'; diff --git a/packages/wyatt_bloc_layout/pubspec.yaml b/packages/wyatt_bloc_layout/pubspec.yaml index c24b039e..ece9dd45 100644 --- a/packages/wyatt_bloc_layout/pubspec.yaml +++ b/packages/wyatt_bloc_layout/pubspec.yaml @@ -3,14 +3,17 @@ description: Layouts based on bloc helper library repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_bloc_layout version: 0.0.1 +publish_to: "none" + environment: - sdk: '>=2.17.0 <3.0.0' + sdk: ">=2.17.0 <3.0.0" dependencies: - flutter: sdk: flutter + flutter_bloc: ^8.1.2 + wyatt_bloc_helper: git: url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages @@ -32,13 +35,11 @@ dependencies: path: packages/wyatt_ui_components dev_dependencies: - flutter_test: sdk: flutter - - + wyatt_analysis: git: url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages ref: wyatt_analysis-v2.4.0 - path: packages/wyatt_analysis \ No newline at end of file + path: packages/wyatt_analysis diff --git a/packages/wyatt_component_copy_with_gen/analysis_options.yaml b/packages/wyatt_component_copy_with_gen/analysis_options.yaml index 50ed209d..e1caf220 100644 --- a/packages/wyatt_component_copy_with_gen/analysis_options.yaml +++ b/packages/wyatt_component_copy_with_gen/analysis_options.yaml @@ -1,7 +1 @@ - - - include: package:wyatt_analysis/analysis_options.yaml - - - diff --git a/packages/wyatt_component_copy_with_gen/pubspec.yaml b/packages/wyatt_component_copy_with_gen/pubspec.yaml index d297befe..fb456294 100644 --- a/packages/wyatt_component_copy_with_gen/pubspec.yaml +++ b/packages/wyatt_component_copy_with_gen/pubspec.yaml @@ -3,6 +3,8 @@ description: Generator for copywith method for components. repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/component_copy_with_gen version: 1.0.0 +publish_to: "none" + environment: sdk: ">=2.19.0 <3.0.0" diff --git a/packages/wyatt_crud_bloc/example/lib/app.dart b/packages/wyatt_crud_bloc/example/lib/app.dart index 7f5e9357..47d7e59e 100644 --- a/packages/wyatt_crud_bloc/example/lib/app.dart +++ b/packages/wyatt_crud_bloc/example/lib/app.dart @@ -92,7 +92,6 @@ class MyHomePage extends StatelessWidget { ); }, ), - const SizedBox(height: 20), ElevatedButton( onPressed: () { @@ -121,9 +120,7 @@ class MyHomePage extends StatelessWidget { ), ElevatedButton( onPressed: () { - context - .read() - .query([LimitQuery(2)]); + context.read().query([LimitQuery(2)]); }, child: const Text("Query"), ), diff --git a/packages/wyatt_crud_bloc/example/lib/app_bloc_observer.dart b/packages/wyatt_crud_bloc/example/lib/app_bloc_observer.dart index 3bbf28e5..630d240d 100644 --- a/packages/wyatt_crud_bloc/example/lib/app_bloc_observer.dart +++ b/packages/wyatt_crud_bloc/example/lib/app_bloc_observer.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/example/test/widget_test.dart b/packages/wyatt_crud_bloc/example/test/widget_test.dart index e69de29b..8b137891 100644 --- a/packages/wyatt_crud_bloc/example/test/widget_test.dart +++ b/packages/wyatt_crud_bloc/example/test/widget_test.dart @@ -0,0 +1 @@ + diff --git a/packages/wyatt_crud_bloc/lib/src/data/data.dart b/packages/wyatt_crud_bloc/lib/src/data/data.dart index ad1ef342..2fbca202 100644 --- a/packages/wyatt_crud_bloc/lib/src/data/data.dart +++ b/packages/wyatt_crud_bloc/lib/src/data/data.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/data/data_sources/local/crud_in_memory_data_source_impl.dart b/packages/wyatt_crud_bloc/lib/src/data/data_sources/local/crud_in_memory_data_source_impl.dart index 5ed56791..bb892251 100644 --- a/packages/wyatt_crud_bloc/lib/src/data/data_sources/local/crud_in_memory_data_source_impl.dart +++ b/packages/wyatt_crud_bloc/lib/src/data/data_sources/local/crud_in_memory_data_source_impl.dart @@ -24,7 +24,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/query.dart'; class CrudInMemoryDataSourceImpl extends CrudDataSource { - CrudInMemoryDataSourceImpl({required this.toMap, Map? data}) : _data = data ?? {}; final Map _data; diff --git a/packages/wyatt_crud_bloc/lib/src/data/data_sources/remote/crud_firestore_data_source_impl.dart b/packages/wyatt_crud_bloc/lib/src/data/data_sources/remote/crud_firestore_data_source_impl.dart index 4059dcb6..e70ecc9c 100644 --- a/packages/wyatt_crud_bloc/lib/src/data/data_sources/remote/crud_firestore_data_source_impl.dart +++ b/packages/wyatt_crud_bloc/lib/src/data/data_sources/remote/crud_firestore_data_source_impl.dart @@ -22,7 +22,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/query.dart'; class CrudFirestoreDataSourceImpl extends CrudDataSource { - CrudFirestoreDataSourceImpl( String collection, { required Model Function( diff --git a/packages/wyatt_crud_bloc/lib/src/data/repositories/crud_repository_impl.dart b/packages/wyatt_crud_bloc/lib/src/data/repositories/crud_repository_impl.dart index 7b8b6fe3..f26fdc1d 100644 --- a/packages/wyatt_crud_bloc/lib/src/data/repositories/crud_repository_impl.dart +++ b/packages/wyatt_crud_bloc/lib/src/data/repositories/crud_repository_impl.dart @@ -23,7 +23,6 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart'; class CrudRepositoryImpl extends CrudRepository { - CrudRepositoryImpl({ required CrudDataSource crudDataSource, }) : _crudDataSource = crudDataSource; diff --git a/packages/wyatt_crud_bloc/lib/src/data/repositories/repositories.dart b/packages/wyatt_crud_bloc/lib/src/data/repositories/repositories.dart index bf40c523..f31c2358 100644 --- a/packages/wyatt_crud_bloc/lib/src/data/repositories/repositories.dart +++ b/packages/wyatt_crud_bloc/lib/src/data/repositories/repositories.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/domain/data_sources/data_sources.dart b/packages/wyatt_crud_bloc/lib/src/domain/data_sources/data_sources.dart index 8495ee03..925fd22f 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/data_sources/data_sources.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/data_sources/data_sources.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/domain/domain.dart b/packages/wyatt_crud_bloc/lib/src/domain/domain.dart index a02a23f3..35c41307 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/domain.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/domain.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/domain/entities/entities.dart b/packages/wyatt_crud_bloc/lib/src/domain/entities/entities.dart index bd9cb1f9..bb2a29f7 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/entities/entities.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/entities/entities.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/domain/entities/query.dart b/packages/wyatt_crud_bloc/lib/src/domain/entities/query.dart index fbb55c9a..a414f3ff 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/entities/query.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/entities/query.dart @@ -25,7 +25,6 @@ abstract class QueryParser { abstract class QueryInterface extends Entity {} class WhereQuery extends QueryInterface { - WhereQuery(this.type, this.field, this.value); final WhereQueryType type; final String field; @@ -33,13 +32,11 @@ class WhereQuery extends QueryInterface { } class LimitQuery extends QueryInterface { - LimitQuery(this.limit); final int limit; } class OrderByQuery extends QueryInterface { - OrderByQuery(this.field, {this.ascending = true}); final String field; final bool ascending; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/repositories/repositories.dart b/packages/wyatt_crud_bloc/lib/src/domain/repositories/repositories.dart index decedffe..fb45fc62 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/repositories/repositories.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/repositories/repositories.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete.dart index f8a5446c..cdebd878 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete.dart @@ -21,7 +21,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/object_model.dart'; import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart'; class Delete extends AsyncUseCase { - Delete(this._crudRepository); final CrudRepository _crudRepository; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete_all.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete_all.dart index 8310f267..a1a36275 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete_all.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/delete_all.dart @@ -19,7 +19,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/object_model.dart'; import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart'; class DeleteAll extends AsyncUseCase { - DeleteAll(this._crudRepository); final CrudRepository _crudRepository; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/get.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/get.dart index 520609a3..40d6719c 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/get.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/get.dart @@ -21,7 +21,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/object_model.dart'; import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart'; class Get extends AsyncUseCase { - Get(this._crudRepository); final CrudRepository _crudRepository; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/get_all.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/get_all.dart index 3d91ab65..6fde76b7 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/get_all.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/get_all.dart @@ -20,7 +20,6 @@ import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart'; class GetAll extends AsyncUseCase> { - GetAll(this._crudRepository); final CrudRepository _crudRepository; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/params.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/params.dart index 3b67e551..3b8bf1ee 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/params.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/params.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/stream_parameters.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/stream_parameters.dart index 6a3cfa0e..ed7768d4 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/stream_parameters.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/stream_parameters.dart @@ -20,7 +20,7 @@ import 'package:wyatt_crud_bloc/src/domain/entities/query.dart'; class StreamParameters { final String? id; final List? conditions; - + StreamParameters({ this.id, this.conditions, diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/update_parameters.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/update_parameters.dart index b23744bd..cbe4cd2b 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/update_parameters.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/params/update_parameters.dart @@ -19,7 +19,7 @@ class UpdateParameters { final String id; final Model? object; final Map? raw; - + UpdateParameters({ required this.id, this.object, diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/query.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/query.dart index d36035c8..2070b015 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/query.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/query.dart @@ -23,7 +23,6 @@ import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart'; class Query extends AsyncUseCase, List> { - Query(this._crudRepository); final CrudRepository _crudRepository; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/stream_query.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/stream_query.dart index 2b2c80e5..35e42b9e 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/stream_query.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/stream_query.dart @@ -14,9 +14,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . - - -// class Stream extends UseCase> { +// class Stream extends UseCase> { // final CrudRepository _crudRepository; // Stream(this._crudRepository); @@ -38,7 +37,8 @@ // throw ClientException('Stream parameters cannot be null.'); // } // } - + // @override -// FutureOrResult>> call(StreamParameters? params) => _crudRepository.stream(); +// FutureOrResult>> call(StreamParameters? params) => +// _crudRepository.stream(); // } diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/update.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/update.dart index bbc29d0f..70c82b73 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/update.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/update.dart @@ -23,7 +23,6 @@ import 'package:wyatt_crud_bloc/src/domain/usecases/params/update_parameters.dar class Update extends AsyncUseCase, void> { - Update(this._crudRepository); final CrudRepository _crudRepository; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/update_all.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/update_all.dart index c9c4505f..60a81957 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/update_all.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/update_all.dart @@ -22,7 +22,6 @@ import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart'; class UpdateAll extends AsyncUseCase, void> { - UpdateAll(this._crudRepository); final CrudRepository _crudRepository; diff --git a/packages/wyatt_crud_bloc/lib/src/domain/usecases/usecases.dart b/packages/wyatt_crud_bloc/lib/src/domain/usecases/usecases.dart index 984bbb28..b53d1702 100644 --- a/packages/wyatt_crud_bloc/lib/src/domain/usecases/usecases.dart +++ b/packages/wyatt_crud_bloc/lib/src/domain/usecases/usecases.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/features/crud/builder/builder.dart b/packages/wyatt_crud_bloc/lib/src/features/crud/builder/builder.dart index 0184a4a5..52cf109d 100644 --- a/packages/wyatt_crud_bloc/lib/src/features/crud/builder/builder.dart +++ b/packages/wyatt_crud_bloc/lib/src/features/crud/builder/builder.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_cubit.dart b/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_cubit.dart index 807cf77a..dcb466aa 100644 --- a/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_cubit.dart +++ b/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_cubit.dart @@ -35,7 +35,6 @@ import 'package:wyatt_crud_bloc/src/domain/usecases/update_all.dart'; part 'crud_state.dart'; abstract class CrudCubit extends Cubit { - CrudCubit() : super(CrudInitial()); Create? get crudCreate; DeleteAll? get crudDeleteAll; diff --git a/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_state.dart b/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_state.dart index 8541a664..f8ab26e2 100644 --- a/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_state.dart +++ b/packages/wyatt_crud_bloc/lib/src/features/crud/cubit/crud_state.dart @@ -36,7 +36,6 @@ class CrudOkReturn extends CrudState { } class CrudError extends CrudState { - const CrudError(this.message); final String? message; @@ -45,7 +44,6 @@ class CrudError extends CrudState { } class CrudLoaded extends CrudSuccess { - const CrudLoaded(this.data); final T? data; @@ -54,7 +52,6 @@ class CrudLoaded extends CrudSuccess { } class CrudListLoaded extends CrudSuccess { - const CrudListLoaded(this.data); final List data; diff --git a/packages/wyatt_crud_bloc/lib/src/features/features.dart b/packages/wyatt_crud_bloc/lib/src/features/features.dart index 996ab833..f91fc8cf 100644 --- a/packages/wyatt_crud_bloc/lib/src/features/features.dart +++ b/packages/wyatt_crud_bloc/lib/src/features/features.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_form_bloc/example/lib/app/app.dart b/packages/wyatt_form_bloc/example/lib/app/app.dart index 63c35292..d69e3a30 100644 --- a/packages/wyatt_form_bloc/example/lib/app/app.dart +++ b/packages/wyatt_form_bloc/example/lib/app/app.dart @@ -35,7 +35,9 @@ class App extends StatelessWidget { FormInput(formFieldEmail, const Email.pure(), metadata: const FormInputMetadata(extra: blue)), FormInput( - formFieldList, const ListOption.pure(choices: ['c1', 'c2', 'c3'],defaultValue: 'c3')), + formFieldList, + const ListOption.pure( + choices: ['c1', 'c2', 'c3'], defaultValue: 'c3')), FormInput(formFieldRadio, const TextString.pure()), FormInput(formFieldPro, const Boolean.pure(), metadata: const FormInputMetadata(name: 'business')), @@ -65,7 +67,7 @@ class App extends StatelessWidget { Widget build(BuildContext context) { FormRepository formRepository = FormRepositoryImpl() ..registerForm(getNormalFormData()); - + // FormRepository formRepository = FormRepositoryImpl() // ..registerForm(WyattFormImpl([ // FormInput(formFieldName, const Name.pure('Test'), diff --git a/packages/wyatt_form_bloc/example/lib/app/metadata.dart b/packages/wyatt_form_bloc/example/lib/app/metadata.dart index 6d66f961..138da48b 100644 --- a/packages/wyatt_form_bloc/example/lib/app/metadata.dart +++ b/packages/wyatt_form_bloc/example/lib/app/metadata.dart @@ -15,10 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -enum Category { - perso, - business -} +enum Category { perso, business } class Metadata { final Category category; diff --git a/packages/wyatt_form_bloc/example/lib/constants.dart b/packages/wyatt_form_bloc/example/lib/constants.dart index a52efc92..f8c7dca6 100644 --- a/packages/wyatt_form_bloc/example/lib/constants.dart +++ b/packages/wyatt_form_bloc/example/lib/constants.dart @@ -1,16 +1,16 @@ // 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 . @@ -23,4 +23,4 @@ const String formFieldList = 'list'; const String formFieldRadio = 'radio'; const String formFieldHidden = 'hidden'; -const String formFieldPro = 'isPro'; \ No newline at end of file +const String formFieldPro = 'isPro'; diff --git a/packages/wyatt_form_bloc/example/lib/sign_up/widgets/sign_up_form.dart b/packages/wyatt_form_bloc/example/lib/sign_up/widgets/sign_up_form.dart index fd87bc2d..3d71e18f 100644 --- a/packages/wyatt_form_bloc/example/lib/sign_up/widgets/sign_up_form.dart +++ b/packages/wyatt_form_bloc/example/lib/sign_up/widgets/sign_up_form.dart @@ -38,8 +38,7 @@ class _NameInput extends StatelessWidget { Widget build(BuildContext context) { return InputBuilderTextController( field: formFieldName, - builder: - (context, cubit, state, field, input, controller, metadata) { + builder: (context, cubit, state, field, input, controller, metadata) { final meta = state.form.metadataOf(field).extra; final color = computeColor(meta); return Row( diff --git a/packages/wyatt_form_bloc/example/test/widget_test.dart b/packages/wyatt_form_bloc/example/test/widget_test.dart index e69de29b..8b137891 100644 --- a/packages/wyatt_form_bloc/example/test/widget_test.dart +++ b/packages/wyatt_form_bloc/example/test/widget_test.dart @@ -0,0 +1 @@ + diff --git a/packages/wyatt_form_bloc/lib/src/core/enums/set_operations.dart b/packages/wyatt_form_bloc/lib/src/core/enums/set_operations.dart index 3e27f437..6395940d 100644 --- a/packages/wyatt_form_bloc/lib/src/core/enums/set_operations.dart +++ b/packages/wyatt_form_bloc/lib/src/core/enums/set_operations.dart @@ -33,7 +33,7 @@ enum SetOperation { /// Add new elements to set. union(FormUnion()); - final FormOperation operation; - const SetOperation(this.operation); + + final FormOperation operation; } diff --git a/packages/wyatt_form_bloc/lib/src/core/enums/validation_error.dart b/packages/wyatt_form_bloc/lib/src/core/enums/validation_error.dart index 4966b6b8..cb9b2526 100644 --- a/packages/wyatt_form_bloc/lib/src/core/enums/validation_error.dart +++ b/packages/wyatt_form_bloc/lib/src/core/enums/validation_error.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_form_bloc/lib/src/data/form/wyatt_form_impl.dart b/packages/wyatt_form_bloc/lib/src/data/form/wyatt_form_impl.dart index 5cf16e28..6e3b9912 100644 --- a/packages/wyatt_form_bloc/lib/src/data/form/wyatt_form_impl.dart +++ b/packages/wyatt_form_bloc/lib/src/data/form/wyatt_form_impl.dart @@ -26,7 +26,6 @@ import 'package:wyatt_form_bloc/src/domain/input_validators/form_input_validator // ignore: must_be_immutable class WyattFormImpl extends WyattForm { - WyattFormImpl( this._inputs, { required String name, @@ -149,7 +148,7 @@ class WyattFormImpl extends WyattForm { @override bool isValidInput(String key) => inputOf(key).validator.valid; - + @override bool isInvalidInput(String key) => inputOf(key).validator.invalid; diff --git a/packages/wyatt_form_bloc/lib/src/data/input_validators/boolean.dart b/packages/wyatt_form_bloc/lib/src/data/input_validators/boolean.dart index dba84780..4cbb9722 100644 --- a/packages/wyatt_form_bloc/lib/src/data/input_validators/boolean.dart +++ b/packages/wyatt_form_bloc/lib/src/data/input_validators/boolean.dart @@ -22,17 +22,15 @@ import 'package:wyatt_form_bloc/src/domain/input_validators/form_input_validator /// {@endtemplate} class Boolean extends NullableValidator { /// {@macro boolean} - const Boolean.pure({bool defaultValue = false}) - : super.pure(defaultValue); + const Boolean.pure({bool defaultValue = false}) : super.pure(defaultValue); /// {@macro boolean} const Boolean.dirty({bool? value}) : super.dirty(value); - + @override ValidationStandardError get onNull => ValidationStandardError.invalid; @override ValidationStandardError? validator(bool? value) => value != null ? null : onNull; - } diff --git a/packages/wyatt_form_bloc/lib/src/data/input_validators/enum_option.dart b/packages/wyatt_form_bloc/lib/src/data/input_validators/enum_option.dart index 8a939fba..b4e1eaa8 100644 --- a/packages/wyatt_form_bloc/lib/src/data/input_validators/enum_option.dart +++ b/packages/wyatt_form_bloc/lib/src/data/input_validators/enum_option.dart @@ -21,8 +21,7 @@ class EnumOption extends AnyValidator, ValidationError> { const EnumOption.pure({this.enums = const [], T? defaultValue}) : super.pure(defaultValue); - const EnumOption.dirty({required this.enums, T? value}) - : super.dirty(value); + const EnumOption.dirty({required this.enums, T? value}) : super.dirty(value); final List enums; diff --git a/packages/wyatt_form_bloc/lib/src/domain/entities/form_input.dart b/packages/wyatt_form_bloc/lib/src/domain/entities/form_input.dart index 741b3ac2..39bdd7e2 100644 --- a/packages/wyatt_form_bloc/lib/src/domain/entities/form_input.dart +++ b/packages/wyatt_form_bloc/lib/src/domain/entities/form_input.dart @@ -61,6 +61,5 @@ class FormInput< List get props => [key, validator, metadata]; @override - String toString() => - 'FormInput(name: $name, $validator)'; + String toString() => 'FormInput(name: $name, $validator)'; } diff --git a/packages/wyatt_form_bloc/lib/src/presentation/features/form_data/form_data_state.dart b/packages/wyatt_form_bloc/lib/src/presentation/features/form_data/form_data_state.dart index ec07d6fc..05caf251 100644 --- a/packages/wyatt_form_bloc/lib/src/presentation/features/form_data/form_data_state.dart +++ b/packages/wyatt_form_bloc/lib/src/presentation/features/form_data/form_data_state.dart @@ -17,12 +17,12 @@ part of 'form_data_cubit.dart'; abstract class FormDataState extends Equatable { - const FormDataState({ required this.form, this.status = FormStatus.pure, this.errorMessage, }); + /// Global status of a form. final FormStatus status; diff --git a/packages/wyatt_form_bloc/lib/src/presentation/features/form_data_impl/form_data_cubit_impl.dart b/packages/wyatt_form_bloc/lib/src/presentation/features/form_data_impl/form_data_cubit_impl.dart index 1894e478..7721ff36 100644 --- a/packages/wyatt_form_bloc/lib/src/presentation/features/form_data_impl/form_data_cubit_impl.dart +++ b/packages/wyatt_form_bloc/lib/src/presentation/features/form_data_impl/form_data_cubit_impl.dart @@ -27,7 +27,6 @@ import 'package:wyatt_form_bloc/src/presentation/features/form_data/form_data_cu part 'form_data_state_impl.dart'; abstract class FormDataCubitImpl extends FormDataCubit { - FormDataCubitImpl(this._formRepository, this._formName) : super(FormDataStateImpl(form: _formRepository.accessForm(_formName))); final FormRepository _formRepository; diff --git a/packages/wyatt_http_client/example/http_client_fastapi_example.dart b/packages/wyatt_http_client/example/http_client_fastapi_example.dart index 9aa2be25..a671d464 100644 --- a/packages/wyatt_http_client/example/http_client_fastapi_example.dart +++ b/packages/wyatt_http_client/example/http_client_fastapi_example.dart @@ -32,14 +32,15 @@ enum EmailVerificationAction { changeEmail; String toSnakeCase() => name.splitMapJoin( - RegExp('[A-Z]'), - onMatch: (m) => '_${m[0]?.toLowerCase()}', - onNonMatch: (n) => n, - ); + RegExp('[A-Z]'), + onMatch: (m) => '_${m[0]?.toLowerCase()}', + onNonMatch: (n) => n, + ); - factory EmailVerificationAction.fromString(String str) => EmailVerificationAction.values.firstWhere( - (element) => element.toSnakeCase() == str, - ); + factory EmailVerificationAction.fromString(String str) => + EmailVerificationAction.values.firstWhere( + (element) => element.toSnakeCase() == str, + ); } class VerifyCode { @@ -56,23 +57,24 @@ class VerifyCode { String? email, String? verificationCode, EmailVerificationAction? action, - }) => VerifyCode( - email: email ?? this.email, - verificationCode: verificationCode ?? this.verificationCode, - action: action ?? this.action, - ); + }) => + VerifyCode( + email: email ?? this.email, + verificationCode: verificationCode ?? this.verificationCode, + action: action ?? this.action, + ); Map toMap() => { - 'email': email, - 'verification_code': verificationCode, - 'action': action.toSnakeCase(), - }; + 'email': email, + 'verification_code': verificationCode, + 'action': action.toSnakeCase(), + }; factory VerifyCode.fromMap(Map map) => VerifyCode( - email: map['email'] as String, - verificationCode: map['verification_code'] as String, - action: EmailVerificationAction.fromString(map['action'] as String), - ); + email: map['email'] as String, + verificationCode: map['verification_code'] as String, + action: EmailVerificationAction.fromString(map['action'] as String), + ); String toJson() => json.encode(toMap()); @@ -95,20 +97,22 @@ class Account { Account copyWith({ String? email, String? sessionId, - }) => Account( - email: email ?? this.email, - sessionId: sessionId ?? this.sessionId, - ); + }) => + Account( + email: email ?? this.email, + sessionId: sessionId ?? this.sessionId, + ); Map toMap() => { - 'email': email, - 'session_id': sessionId, - }; + 'email': email, + 'session_id': sessionId, + }; factory Account.fromMap(Map map) => Account( - email: map['email'] as String, - sessionId: map['session_id'] != null ? map['session_id'] as String : null, - ); + email: map['email'] as String, + sessionId: + map['session_id'] != null ? map['session_id'] as String : null, + ); String toJson() => json.encode(toMap()); @@ -130,20 +134,21 @@ class SignUp { SignUp copyWith({ String? sessionId, String? password, - }) => SignUp( - sessionId: sessionId ?? this.sessionId, - password: password ?? this.password, - ); + }) => + SignUp( + sessionId: sessionId ?? this.sessionId, + password: password ?? this.password, + ); Map toMap() => { - 'session_id': sessionId, - 'password': password, - }; + 'session_id': sessionId, + 'password': password, + }; factory SignUp.fromMap(Map map) => SignUp( - sessionId: map['session_id'] as String, - password: map['password'] as String, - ); + sessionId: map['session_id'] as String, + password: map['password'] as String, + ); String toJson() => json.encode(toMap()); @@ -168,23 +173,24 @@ class TokenSuccess { String? accessToken, String? refreshToken, Account? account, - }) => TokenSuccess( - accessToken: accessToken ?? this.accessToken, - refreshToken: refreshToken ?? this.refreshToken, - account: account ?? this.account, - ); + }) => + TokenSuccess( + accessToken: accessToken ?? this.accessToken, + refreshToken: refreshToken ?? this.refreshToken, + account: account ?? this.account, + ); Map toMap() => { - 'access_token': accessToken, - 'refresh_token': refreshToken, - 'account': account.toMap(), - }; + 'access_token': accessToken, + 'refresh_token': refreshToken, + 'account': account.toMap(), + }; factory TokenSuccess.fromMap(Map map) => TokenSuccess( - accessToken: map['access_token'] as String, - refreshToken: map['refresh_token'] as String, - account: Account.fromMap(map['account'] as Map), - ); + accessToken: map['access_token'] as String, + refreshToken: map['refresh_token'] as String, + account: Account.fromMap(map['account'] as Map), + ); String toJson() => json.encode(toMap()); @@ -207,20 +213,21 @@ class Login { Login copyWith({ String? email, String? password, - }) => Login( - email: email ?? this.email, - password: password ?? this.password, - ); + }) => + Login( + email: email ?? this.email, + password: password ?? this.password, + ); Map toMap() => { - 'email': email, - 'password': password, - }; + 'email': email, + 'password': password, + }; factory Login.fromMap(Map map) => Login( - email: map['email'] as String, - password: map['password'] as String, - ); + email: map['email'] as String, + password: map['password'] as String, + ); String toJson() => json.encode(toMap()); diff --git a/packages/wyatt_http_client/lib/src/middleware_client.dart b/packages/wyatt_http_client/lib/src/middleware_client.dart index 389b6fce..14cbd094 100644 --- a/packages/wyatt_http_client/lib/src/middleware_client.dart +++ b/packages/wyatt_http_client/lib/src/middleware_client.dart @@ -25,7 +25,6 @@ import 'package:wyatt_http_client/src/pipeline.dart'; import 'package:wyatt_http_client/src/utils/http_methods.dart'; class MiddlewareClient extends BaseClient { - MiddlewareClient({ Pipeline? pipeline, Client? inner, diff --git a/packages/wyatt_http_client/lib/src/middlewares/access_token_auth_middleware.dart b/packages/wyatt_http_client/lib/src/middlewares/access_token_auth_middleware.dart index ece1af01..1bb8b149 100644 --- a/packages/wyatt_http_client/lib/src/middlewares/access_token_auth_middleware.dart +++ b/packages/wyatt_http_client/lib/src/middlewares/access_token_auth_middleware.dart @@ -1,16 +1,15 @@ // 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 . - diff --git a/packages/wyatt_http_client/lib/src/middlewares/basic_auth_middleware.dart b/packages/wyatt_http_client/lib/src/middlewares/basic_auth_middleware.dart index 432a33a2..529e3113 100644 --- a/packages/wyatt_http_client/lib/src/middlewares/basic_auth_middleware.dart +++ b/packages/wyatt_http_client/lib/src/middlewares/basic_auth_middleware.dart @@ -23,7 +23,6 @@ import 'package:wyatt_http_client/src/utils/authentication_methods.dart'; import 'package:wyatt_http_client/src/utils/header_keys.dart'; class BasicAuthMiddleware with OnRequestMiddleware implements Middleware { - BasicAuthMiddleware({ this.username, this.password, diff --git a/packages/wyatt_http_client/lib/src/middlewares/digest_auth_middleware.dart b/packages/wyatt_http_client/lib/src/middlewares/digest_auth_middleware.dart index 64dd5020..c09d0423 100644 --- a/packages/wyatt_http_client/lib/src/middlewares/digest_auth_middleware.dart +++ b/packages/wyatt_http_client/lib/src/middlewares/digest_auth_middleware.dart @@ -25,7 +25,6 @@ import 'package:wyatt_http_client/src/utils/http_status.dart'; class DigestAuthMiddleware with OnRequestMiddleware, OnResponseMiddleware implements Middleware { - DigestAuthMiddleware({ required this.username, required this.password, diff --git a/packages/wyatt_http_client/lib/src/middlewares/middlewares.dart b/packages/wyatt_http_client/lib/src/middlewares/middlewares.dart index 724b3ac9..9c2b70b0 100644 --- a/packages/wyatt_http_client/lib/src/middlewares/middlewares.dart +++ b/packages/wyatt_http_client/lib/src/middlewares/middlewares.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_http_client/lib/src/middlewares/refresh_token_auth_middleware.dart b/packages/wyatt_http_client/lib/src/middlewares/refresh_token_auth_middleware.dart index fc6937e6..19f3f137 100644 --- a/packages/wyatt_http_client/lib/src/middlewares/refresh_token_auth_middleware.dart +++ b/packages/wyatt_http_client/lib/src/middlewares/refresh_token_auth_middleware.dart @@ -31,7 +31,6 @@ typedef TokenParser = String Function(Map); class RefreshTokenAuthMiddleware with OnRequestMiddleware, OnResponseMiddleware implements Middleware { - RefreshTokenAuthMiddleware({ required this.authorizationEndpoint, required this.tokenEndpoint, diff --git a/packages/wyatt_http_client/lib/src/middlewares/unsafe_auth_middleware.dart b/packages/wyatt_http_client/lib/src/middlewares/unsafe_auth_middleware.dart index 4b43359a..724d7211 100644 --- a/packages/wyatt_http_client/lib/src/middlewares/unsafe_auth_middleware.dart +++ b/packages/wyatt_http_client/lib/src/middlewares/unsafe_auth_middleware.dart @@ -20,7 +20,6 @@ import 'package:wyatt_http_client/src/models/middleware_request.dart'; import 'package:wyatt_http_client/src/utils/convert.dart'; class UnsafeAuthMiddleware with OnRequestMiddleware implements Middleware { - UnsafeAuthMiddleware({ this.username, this.password, diff --git a/packages/wyatt_http_client/lib/src/middlewares/uri_prefix_middleware.dart b/packages/wyatt_http_client/lib/src/middlewares/uri_prefix_middleware.dart index 1eec0fe4..04c3232f 100644 --- a/packages/wyatt_http_client/lib/src/middlewares/uri_prefix_middleware.dart +++ b/packages/wyatt_http_client/lib/src/middlewares/uri_prefix_middleware.dart @@ -20,7 +20,6 @@ import 'package:wyatt_http_client/src/models/middleware_request.dart'; import 'package:wyatt_http_client/src/utils/protocols.dart'; class UriPrefixMiddleware with OnRequestMiddleware implements Middleware { - UriPrefixMiddleware({ required this.protocol, required this.authority, diff --git a/packages/wyatt_http_client/lib/src/models/middleware_context.dart b/packages/wyatt_http_client/lib/src/models/middleware_context.dart index 9fb1db30..503c2e3e 100644 --- a/packages/wyatt_http_client/lib/src/models/middleware_context.dart +++ b/packages/wyatt_http_client/lib/src/models/middleware_context.dart @@ -44,15 +44,19 @@ class MiddlewareContext { MiddlewareRequest? lastRequest, MiddlewareResponse? originalResponse, MiddlewareResponse? lastResponse, - }) => MiddlewareContext( - pipeline: pipeline ?? this.pipeline, - client: client ?? this.client, - originalRequest: originalRequest ?? this.originalRequest, - lastRequest: lastRequest ?? this.lastRequest, - originalResponse: originalResponse ?? this.originalResponse, - lastResponse: lastResponse ?? this.lastResponse, - ); + }) => + MiddlewareContext( + pipeline: pipeline ?? this.pipeline, + client: client ?? this.client, + originalRequest: originalRequest ?? this.originalRequest, + lastRequest: lastRequest ?? this.lastRequest, + originalResponse: originalResponse ?? this.originalResponse, + lastResponse: lastResponse ?? this.lastResponse, + ); @override - String toString() => 'MiddlewareContext(pipeline: $pipeline, client: $client, originalRequest: $originalRequest, lastRequest: $lastRequest, originalResponse: $originalResponse, lastResponse: $lastResponse)'; + String toString() => + 'MiddlewareContext(pipeline: $pipeline, client: $client, ' + 'originalRequest: $originalRequest, lastRequest: $lastRequest, ' + 'originalResponse: $originalResponse, lastResponse: $lastResponse)'; } diff --git a/packages/wyatt_http_client/lib/src/models/middleware_response.dart b/packages/wyatt_http_client/lib/src/models/middleware_response.dart index d58a2591..500c17c3 100644 --- a/packages/wyatt_http_client/lib/src/models/middleware_response.dart +++ b/packages/wyatt_http_client/lib/src/models/middleware_response.dart @@ -31,6 +31,7 @@ class MiddlewareResponse { return ''; } } + int? get contentLength => httpResponse.contentLength; Map get headers => httpResponse.headers; @@ -40,11 +41,11 @@ class MiddlewareResponse { MiddlewareResponse copyWith({ BaseResponse? httpResponse, - }) => MiddlewareResponse( - httpResponse: httpResponse ?? this.httpResponse, - ); + }) => + MiddlewareResponse( + httpResponse: httpResponse ?? this.httpResponse, + ); @override - String toString() => - 'MiddlewareResponse(httpResponse: $httpResponse)'; + String toString() => 'MiddlewareResponse(httpResponse: $httpResponse)'; } diff --git a/packages/wyatt_http_client/lib/src/models/models.dart b/packages/wyatt_http_client/lib/src/models/models.dart index 4170d54b..95b3b377 100644 --- a/packages/wyatt_http_client/lib/src/models/models.dart +++ b/packages/wyatt_http_client/lib/src/models/models.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_http_client/lib/src/models/unfreezed_request.dart b/packages/wyatt_http_client/lib/src/models/unfreezed_request.dart index 437b21d3..d29c15d8 100644 --- a/packages/wyatt_http_client/lib/src/models/unfreezed_request.dart +++ b/packages/wyatt_http_client/lib/src/models/unfreezed_request.dart @@ -17,7 +17,6 @@ import 'dart:convert'; class UnfreezedRequest { - UnfreezedRequest({ required this.method, required this.url, @@ -37,15 +36,16 @@ class UnfreezedRequest { Map? headers, Object? body, Encoding? encoding, - }) => UnfreezedRequest( - method: method ?? this.method, - url: url ?? this.url, - headers: headers ?? this.headers, - body: body ?? this.body, - encoding: encoding ?? this.encoding, - ); + }) => + UnfreezedRequest( + method: method ?? this.method, + url: url ?? this.url, + headers: headers ?? this.headers, + body: body ?? this.body, + encoding: encoding ?? this.encoding, + ); @override String toString() => 'UnfreezedRequest(method: $method, url: $url, headers: ' - '$headers, body: $body, encoding: $encoding)'; + '$headers, body: $body, encoding: $encoding)'; } diff --git a/packages/wyatt_http_client/lib/src/pipeline.dart b/packages/wyatt_http_client/lib/src/pipeline.dart index bf0b2107..ae4029ec 100644 --- a/packages/wyatt_http_client/lib/src/pipeline.dart +++ b/packages/wyatt_http_client/lib/src/pipeline.dart @@ -20,7 +20,6 @@ import 'package:wyatt_http_client/src/models/middleware_request.dart'; import 'package:wyatt_http_client/src/models/middleware_response.dart'; class Pipeline { - Pipeline() : _middlewares = []; Pipeline.fromIterable(Iterable middlewares) : _middlewares = middlewares.toList(); @@ -65,8 +64,7 @@ class Pipeline { MiddlewareContext ctx = context.copyWith(lastRequest: req); for (final middleware in _middlewares) { if (middleware is OnRequestMiddleware) { - req = await (middleware as OnRequestMiddleware) - .onRequest(ctx, request); + req = await (middleware as OnRequestMiddleware).onRequest(ctx, request); ctx = context.copyWith(lastRequest: req); } } diff --git a/packages/wyatt_http_client/lib/src/utils/convert.dart b/packages/wyatt_http_client/lib/src/utils/convert.dart index 059b20a5..1f287757 100644 --- a/packages/wyatt_http_client/lib/src/utils/convert.dart +++ b/packages/wyatt_http_client/lib/src/utils/convert.dart @@ -34,10 +34,12 @@ class Convert { static String mapToQuery(Map map, {Encoding? encoding}) { final pairs = >[]; - map.forEach((key, value) => pairs.add([ - Uri.encodeQueryComponent(key, encoding: encoding ?? utf8), - Uri.encodeQueryComponent(value, encoding: encoding ?? utf8) - ]),); + map.forEach( + (key, value) => pairs.add([ + Uri.encodeQueryComponent(key, encoding: encoding ?? utf8), + Uri.encodeQueryComponent(value, encoding: encoding ?? utf8) + ]), + ); return pairs.map((pair) => '${pair[0]}=${pair[1]}').join('&'); } } diff --git a/packages/wyatt_http_client/lib/src/utils/digest_auth.dart b/packages/wyatt_http_client/lib/src/utils/digest_auth.dart index 1a8ee9f1..ba16c0aa 100644 --- a/packages/wyatt_http_client/lib/src/utils/digest_auth.dart +++ b/packages/wyatt_http_client/lib/src/utils/digest_auth.dart @@ -19,7 +19,8 @@ import 'dart:math'; import 'package:wyatt_http_client/src/utils/convert.dart'; import 'package:wyatt_http_client/src/utils/crypto.dart'; -class DigestAuth { // request counter +class DigestAuth { + // request counter DigestAuth(this.username, this.password); String username; diff --git a/packages/wyatt_http_client/lib/src/utils/http_methods.dart b/packages/wyatt_http_client/lib/src/utils/http_methods.dart index 49087965..7b0a4c7a 100644 --- a/packages/wyatt_http_client/lib/src/utils/http_methods.dart +++ b/packages/wyatt_http_client/lib/src/utils/http_methods.dart @@ -22,7 +22,7 @@ enum HttpMethods { patch('PATCH'), delete('DELETE'); - final String method; - const HttpMethods(this.method); + + final String method; } diff --git a/packages/wyatt_http_client/lib/src/utils/http_status.dart b/packages/wyatt_http_client/lib/src/utils/http_status.dart index 2714b5ba..e5360309 100644 --- a/packages/wyatt_http_client/lib/src/utils/http_status.dart +++ b/packages/wyatt_http_client/lib/src/utils/http_status.dart @@ -81,10 +81,13 @@ enum HttpStatus { // Client generated status code. networkConnectTimeoutError(599); - final int statusCode; - const HttpStatus(this.statusCode); + factory HttpStatus.from(int status) => + HttpStatus.values.firstWhere((element) => element.statusCode == status); + + final int statusCode; + bool equals(Object other) { if (other is HttpStatus) { return statusCode == other.statusCode; @@ -104,8 +107,4 @@ enum HttpStatus { bool isClientError() => statusCode >= 400 && statusCode < 500; bool isServerError() => statusCode >= 500 && statusCode < 600; - - factory HttpStatus.from(int status) => HttpStatus.values - .firstWhere((element) => element.statusCode == status); - } diff --git a/packages/wyatt_http_client/lib/src/utils/utils.dart b/packages/wyatt_http_client/lib/src/utils/utils.dart index 5dfc082c..91d8efc1 100644 --- a/packages/wyatt_http_client/lib/src/utils/utils.dart +++ b/packages/wyatt_http_client/lib/src/utils/utils.dart @@ -1,16 +1,16 @@ // 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 . diff --git a/packages/wyatt_notification_bloc/example/lib/main.dart b/packages/wyatt_notification_bloc/example/lib/main.dart index e0160294..008fa38e 100644 --- a/packages/wyatt_notification_bloc/example/lib/main.dart +++ b/packages/wyatt_notification_bloc/example/lib/main.dart @@ -100,7 +100,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.headline4, + style: Theme.of(context).textTheme.headlineMedium, ), ], ), diff --git a/packages/wyatt_notification_bloc/lib/src/wyatt_notification_bloc_base.dart b/packages/wyatt_notification_bloc/lib/src/wyatt_notification_bloc_base.dart index e8a6f159..41deac69 100644 --- a/packages/wyatt_notification_bloc/lib/src/wyatt_notification_bloc_base.dart +++ b/packages/wyatt_notification_bloc/lib/src/wyatt_notification_bloc_base.dart @@ -1,5 +1,3 @@ -// TODO: Put public facing types in this file. - /// Checks if you are awesome. Spoiler: you are. class Awesome { bool get isAwesome => true; diff --git a/packages/wyatt_type_utils/example/lib/error.dart b/packages/wyatt_type_utils/example/lib/error.dart index 945855bf..27a67828 100644 --- a/packages/wyatt_type_utils/example/lib/error.dart +++ b/packages/wyatt_type_utils/example/lib/error.dart @@ -15,7 +15,6 @@ // along with this program. If not, see . class AppError { - const AppError(this.message); final String message; diff --git a/packages/wyatt_type_utils/example/lib/todo.dart b/packages/wyatt_type_utils/example/lib/todo.dart index e5f21752..2751b70b 100644 --- a/packages/wyatt_type_utils/example/lib/todo.dart +++ b/packages/wyatt_type_utils/example/lib/todo.dart @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -// ignore_for_file: public_member_api_docs, sort_constructors_first, +// ignore_for_file: public_member_api_docs, sort_constructors_first, // ignore_for_file: avoid_equals_and_hash_code_on_mutable_classes import 'dart:convert'; diff --git a/packages/wyatt_type_utils/lib/src/either/option.dart b/packages/wyatt_type_utils/lib/src/either/option.dart index 3f8e9a74..d97ed2ac 100644 --- a/packages/wyatt_type_utils/lib/src/either/option.dart +++ b/packages/wyatt_type_utils/lib/src/either/option.dart @@ -32,13 +32,13 @@ class OptionException extends _EitherBaseException { } /// {@template option} -/// [Option] is a container object which may or may not contain a non-null -/// value. If a [Value] is present, isPresent() will return true and get() +/// [Option] is a container object which may or may not contain a non-null +/// value. If a [Value] is present, isPresent() will return true and get() /// will return the value. -/// -/// Additional methods that depend on the presence or absence of -/// a contained value are provided, such as orElse() (return a default value -/// if value not present) and ifPresent() (execute a block of code if the +/// +/// Additional methods that depend on the presence or absence of +/// a contained value are provided, such as orElse() (return a default value +/// if value not present) and ifPresent() (execute a block of code if the /// value is present). /// {@endtemplate} abstract class Option extends _EitherBase { @@ -69,7 +69,7 @@ abstract class Option extends _EitherBase { (left) => value(left), (right) => none(), ); - + /// Match **async** [Value] and [None]. Future matchAsync( Future Function(T value) value, @@ -172,7 +172,6 @@ abstract class Option extends _EitherBase { } class Value extends Option with _Left { - /// {@macro ok} const Value(this.value) : super._(); final T value; diff --git a/packages/wyatt_type_utils/lib/src/either/result.dart b/packages/wyatt_type_utils/lib/src/either/result.dart index 6333e46d..c4d03189 100644 --- a/packages/wyatt_type_utils/lib/src/either/result.dart +++ b/packages/wyatt_type_utils/lib/src/either/result.dart @@ -203,7 +203,6 @@ abstract class Result extends _EitherBase { /// {@macro result} /// {@endtemplate} class Ok extends Result with _Left { - /// {@macro ok} const Ok(this.value) : super._(); final T value; @@ -268,7 +267,6 @@ class Ok extends Result with _Left { /// {@macro result} /// {@endtemplate} class Err extends Result with _Right { - /// {@macro err} const Err(this.error) : super._(); final E error; diff --git a/packages/wyatt_type_utils/lib/src/extensions/iterable_extension.dart b/packages/wyatt_type_utils/lib/src/extensions/iterable_extension.dart index d69fd22b..0d04c775 100644 --- a/packages/wyatt_type_utils/lib/src/extensions/iterable_extension.dart +++ b/packages/wyatt_type_utils/lib/src/extensions/iterable_extension.dart @@ -32,7 +32,7 @@ extension IterableIntExtension on Iterable? { Uint8List toTypedList() => Uint8List.fromList(this?.toList() ?? []); /// Converts a [Uint8List] to a [String] using the specified [Encoding]. - String toStr({final Encoding to = Encoding.utf16}) { + String toStr({Encoding to = Encoding.utf16}) { String str; switch (to) { case Encoding.utf8: diff --git a/packages/wyatt_type_utils/lib/src/extensions/string_extension.dart b/packages/wyatt_type_utils/lib/src/extensions/string_extension.dart index 3e28b3c7..db75dd62 100644 --- a/packages/wyatt_type_utils/lib/src/extensions/string_extension.dart +++ b/packages/wyatt_type_utils/lib/src/extensions/string_extension.dart @@ -28,7 +28,7 @@ extension StringExtension on String? { bool get isNotNullOrEmpty => this != null && this!.isNotEmpty; /// Converts a [String] to a [Uint8List] using the specified [Encoding]. - Uint8List toBytes({final Encoding from = Encoding.utf16}) { + Uint8List toBytes({Encoding from = Encoding.utf16}) { Uint8List bytes; switch (from) { case Encoding.utf8: diff --git a/packages/wyatt_type_utils/lib/src/pair/pair.dart b/packages/wyatt_type_utils/lib/src/pair/pair.dart index ca66961d..2a2104f9 100644 --- a/packages/wyatt_type_utils/lib/src/pair/pair.dart +++ b/packages/wyatt_type_utils/lib/src/pair/pair.dart @@ -22,7 +22,6 @@ extension PairExtension on Pair { /// [Pair] is a simple object which contains pair of two values. /// {@endtemplate} class Pair { - /// {@macro pair} const Pair(this.left, this.right); final L? left; diff --git a/packages/wyatt_type_utils/test/result_test.dart b/packages/wyatt_type_utils/test/result_test.dart index eababedf..53706fd5 100644 --- a/packages/wyatt_type_utils/test/result_test.dart +++ b/packages/wyatt_type_utils/test/result_test.dart @@ -351,14 +351,16 @@ void main() { (await Result.tryCatchAsync( () => throw Exception('not success'), (err) => 'error', - )).isErr, + )) + .isErr, true, ); expect( (await Result.tryCatchAsync( () => Future.value(2), (err) => 'error', - )).isOk, + )) + .isOk, true, ); }, diff --git a/packages/wyatt_ui_components/lib/src/domain/entities/loader/loader_component.dart b/packages/wyatt_ui_components/lib/src/domain/entities/loader/loader_component.dart index 9d26ba10..6e3a8945 100644 --- a/packages/wyatt_ui_components/lib/src/domain/entities/loader/loader_component.dart +++ b/packages/wyatt_ui_components/lib/src/domain/entities/loader/loader_component.dart @@ -44,7 +44,7 @@ abstract class LoaderComponent extends Component /// Animation duration final Duration? duration; - + /// Flip the animation final bool? flip; } diff --git a/packages/wyatt_ui_components/lib/src/domain/entities/rich_text_builder/rich_text_builder_component.dart b/packages/wyatt_ui_components/lib/src/domain/entities/rich_text_builder/rich_text_builder_component.dart index 31fed0cf..da2bfb91 100644 --- a/packages/wyatt_ui_components/lib/src/domain/entities/rich_text_builder/rich_text_builder_component.dart +++ b/packages/wyatt_ui_components/lib/src/domain/entities/rich_text_builder/rich_text_builder_component.dart @@ -41,7 +41,7 @@ abstract class RichTextBuilderComponent extends Component final TextStyle? defaultStyle; /// Used styles in this rich text component. - /// + /// /// e.g. /// ```dart /// styles = {'red': TextStyle(color: Colors.red)}; diff --git a/packages/wyatt_ui_components/lib/src/features/component_theme.dart b/packages/wyatt_ui_components/lib/src/features/component_theme.dart index 49de4780..0ed44487 100644 --- a/packages/wyatt_ui_components/lib/src/features/component_theme.dart +++ b/packages/wyatt_ui_components/lib/src/features/component_theme.dart @@ -18,7 +18,6 @@ import 'package:flutter/material.dart'; import 'package:wyatt_ui_components/src/features/features.dart'; class ComponentTheme extends StatelessWidget { - const ComponentTheme({ required this.child, required this.componentThemeWidget, diff --git a/packages/wyatt_ui_kit/example/test/widget_test.dart b/packages/wyatt_ui_kit/example/test/widget_test.dart index e69de29b..8b137891 100644 --- a/packages/wyatt_ui_kit/example/test/widget_test.dart +++ b/packages/wyatt_ui_kit/example/test/widget_test.dart @@ -0,0 +1 @@ + diff --git a/packages/wyatt_ui_kit/lib/src/components/buttons/file_selection_button/file_selection_button_theme_resolver.dart b/packages/wyatt_ui_kit/lib/src/components/buttons/file_selection_button/file_selection_button_theme_resolver.dart index feb496b7..0e8d2051 100644 --- a/packages/wyatt_ui_kit/lib/src/components/buttons/file_selection_button/file_selection_button_theme_resolver.dart +++ b/packages/wyatt_ui_kit/lib/src/components/buttons/file_selection_button/file_selection_button_theme_resolver.dart @@ -16,7 +16,6 @@ import 'package:flutter/material.dart'; import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; -import 'package:wyatt_ui_kit/src/components/buttons/cubit/button_cubit.dart'; import 'package:wyatt_ui_kit/wyatt_ui_kit.dart'; class FileSelectionButtonThemeResolver extends ThemeResolver< diff --git a/packages/wyatt_ui_kit/lib/src/components/buttons/flat_button/flat_button_screen.dart b/packages/wyatt_ui_kit/lib/src/components/buttons/flat_button/flat_button_screen.dart index f16b626c..43a4fa52 100644 --- a/packages/wyatt_ui_kit/lib/src/components/buttons/flat_button/flat_button_screen.dart +++ b/packages/wyatt_ui_kit/lib/src/components/buttons/flat_button/flat_button_screen.dart @@ -63,6 +63,7 @@ class FlatButtonScreen extends CubitScreen { @override ButtonCubit init(BuildContext context, ButtonCubit bloc) { disabled?.addListener(() => StateListener.listen(disabled, bloc)); + /// Set the initial state depending on the disabled value /// after adding the listener. if (disabled?.value ?? false) { diff --git a/packages/wyatt_ui_kit/lib/src/components/buttons/symbol_button/symbol_button_theme_resolver.dart b/packages/wyatt_ui_kit/lib/src/components/buttons/symbol_button/symbol_button_theme_resolver.dart index 6124ccc1..3066c870 100644 --- a/packages/wyatt_ui_kit/lib/src/components/buttons/symbol_button/symbol_button_theme_resolver.dart +++ b/packages/wyatt_ui_kit/lib/src/components/buttons/symbol_button/symbol_button_theme_resolver.dart @@ -16,7 +16,6 @@ import 'package:flutter/material.dart'; import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; -import 'package:wyatt_ui_kit/src/components/buttons/cubit/button_cubit.dart'; import 'package:wyatt_ui_kit/wyatt_ui_kit.dart'; class SymbolButtonThemeResolver extends ThemeResolver. diff --git a/packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart b/packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart index a8f83f3a..0f365423 100644 --- a/packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart +++ b/packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart @@ -24,10 +24,10 @@ class WyattComponentThemeData { loaderComponent: const Loader(), richTextBuilderComponent: const RichTextBuilder(), textInputComponent: const TextInput(), - fileSelectionButtonComponent: FileSelectionButton(), - flatButtonComponent: FlatButton(), - simpleIconButtonComponent: SimpleIconButton(), - symbolButtonComponent: SymbolButton(), + fileSelectionButtonComponent: const FileSelectionButton(), + flatButtonComponent: const FlatButton(), + simpleIconButtonComponent: const SimpleIconButton(), + symbolButtonComponent: const SymbolButton(), informationCardComponent: const InformationCard(), portfolioCardComponent: const PortfolioCard(), quoteCardComponent: const QuoteCard(), diff --git a/packages/wyatt_ui_layout/pubspec.yaml b/packages/wyatt_ui_layout/pubspec.yaml index 3a6da750..46debeab 100644 --- a/packages/wyatt_ui_layout/pubspec.yaml +++ b/packages/wyatt_ui_layout/pubspec.yaml @@ -3,6 +3,8 @@ description: Main layouts to help you build your application views. repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_ui_layout version: 0.0.1 +publish_to: "none" + environment: sdk: ">=2.17.0 <3.0.0"