clean(packages): apply dart fix (close #106)
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit was merged in pull request #107.
This commit is contained in:
+1
-2
@@ -24,9 +24,8 @@ import 'package:wyatt_http_client/wyatt_http_client.dart';
|
||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
class AlbumApiDataSourceImpl extends AlbumRemoteDataSource {
|
||||
final MiddlewareClient _client;
|
||||
|
||||
AlbumApiDataSourceImpl(this._client);
|
||||
final MiddlewareClient _client;
|
||||
|
||||
@override
|
||||
Future<Album> getAlbum(int id) async {
|
||||
|
||||
+1
-2
@@ -24,9 +24,8 @@ import 'package:wyatt_http_client/wyatt_http_client.dart';
|
||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
class PhotoApiDataSourceImpl extends PhotoRemoteDataSource {
|
||||
final MiddlewareClient _client;
|
||||
|
||||
PhotoApiDataSourceImpl(this._client);
|
||||
final MiddlewareClient _client;
|
||||
|
||||
@override
|
||||
Future<Photo> getPhoto(int id) async {
|
||||
|
||||
+3
-3
@@ -24,15 +24,15 @@ import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
class PhotoRepositoryImpl extends PhotoRepository {
|
||||
final PhotoRemoteDataSource _photoRemoteDataSource;
|
||||
final AlbumRemoteDataSource _albumRemoteDataSource;
|
||||
final FavoriteLocalDataSource _favoriteLocalDataSource;
|
||||
|
||||
PhotoRepositoryImpl(
|
||||
this._photoRemoteDataSource,
|
||||
this._albumRemoteDataSource,
|
||||
this._favoriteLocalDataSource,
|
||||
);
|
||||
final PhotoRemoteDataSource _photoRemoteDataSource;
|
||||
final AlbumRemoteDataSource _albumRemoteDataSource;
|
||||
final FavoriteLocalDataSource _favoriteLocalDataSource;
|
||||
|
||||
@override
|
||||
FutureOrResult<void> addPhotoToFavorites(Photo photo) => Result.tryCatchAsync(
|
||||
|
||||
+1
-1
@@ -21,9 +21,9 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
|
||||
class AddPhotoToFavorites extends AsyncUseCase<Photo, List<Photo>> {
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
AddPhotoToFavorites(this._photoRepository);
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
@override
|
||||
FutureOrResult<List<Photo>> execute(Photo? params) async {
|
||||
|
||||
+1
-1
@@ -20,9 +20,9 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
|
||||
class CheckIfPhotoIsInFavorites extends AsyncUseCase<int, bool> {
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
CheckIfPhotoIsInFavorites(this._photoRepository);
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
@override
|
||||
FutureOrResult<bool> execute(int? params) async =>
|
||||
|
||||
+1
-1
@@ -19,9 +19,9 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
|
||||
class DisplayFavorites extends AsyncUseCase<NoParam, List<Photo>> {
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
DisplayFavorites(this._photoRepository);
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
@override
|
||||
FutureOrResult<List<Photo>> execute(void params) {
|
||||
|
||||
@@ -21,9 +21,9 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
|
||||
class DisplayPhoto extends AsyncUseCase<int, Photo> {
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
DisplayPhoto(this._photoRepository);
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
@override
|
||||
FutureOrResult<Photo> execute(int? params) {
|
||||
|
||||
@@ -22,9 +22,9 @@ import 'package:architecture_example/domain/usecases/photos/params/query_paramet
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
|
||||
class OpenAlbum extends AsyncUseCase<QueryParameters, List<Photo>> {
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
OpenAlbum(this._photoRepository);
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
@override
|
||||
FutureOrResult<List<Photo>> execute(QueryParameters? params) {
|
||||
|
||||
+2
-2
@@ -15,9 +15,9 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
class QueryParameters {
|
||||
|
||||
QueryParameters(this.start, this.limit, {this.albumId = -1});
|
||||
final int albumId;
|
||||
final int? start;
|
||||
final int? limit;
|
||||
|
||||
QueryParameters(this.start, this.limit, {this.albumId = -1});
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,9 +21,9 @@ import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
|
||||
class RemovePhotoFromFavorites extends AsyncUseCase<int, List<Photo>> {
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
RemovePhotoFromFavorites(this._photoRepository);
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
@override
|
||||
FutureOrResult<List<Photo>> execute(int? params) async {
|
||||
|
||||
+1
-1
@@ -22,9 +22,9 @@ import 'package:architecture_example/domain/usecases/photos/params/query_paramet
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
|
||||
class RetrieveAllAlbums extends AsyncUseCase<QueryParameters, List<Album>> {
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
RetrieveAllAlbums(this._photoRepository);
|
||||
final PhotoRepository _photoRepository;
|
||||
|
||||
@override
|
||||
FutureOrResult<List<Album>> execute(QueryParameters? params) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,6 @@ EventTransformer<E> throttleDroppable<E>(Duration duration) =>
|
||||
(events, mapper) => droppable<E>().call(events.throttle(duration), mapper);
|
||||
|
||||
class AlbumBloc extends Bloc<AlbumEvent, AlbumState> {
|
||||
final RetrieveAllAlbums _retrieveAllAlbums;
|
||||
|
||||
AlbumBloc(this._retrieveAllAlbums) : super(const AlbumState()) {
|
||||
on<AlbumFetched>(
|
||||
@@ -41,6 +40,7 @@ class AlbumBloc extends Bloc<AlbumEvent, AlbumState> {
|
||||
transformer: throttleDroppable(throttleDuration),
|
||||
);
|
||||
}
|
||||
final RetrieveAllAlbums _retrieveAllAlbums;
|
||||
|
||||
Future<void> _onAlbumFetched(
|
||||
AlbumFetched event,
|
||||
|
||||
+3
-3
@@ -26,19 +26,19 @@ abstract class PhotoDetailsState extends Equatable {
|
||||
class PhotoDetailsInitial extends PhotoDetailsState {}
|
||||
|
||||
class PhotoDetailsSuccess extends PhotoDetailsState {
|
||||
final Photo photo;
|
||||
final bool isFavorite;
|
||||
|
||||
const PhotoDetailsSuccess(this.photo, {required this.isFavorite});
|
||||
final Photo photo;
|
||||
final bool isFavorite;
|
||||
|
||||
@override
|
||||
List<Object> get props => [photo, isFavorite];
|
||||
}
|
||||
|
||||
class PhotoDetailsFailure extends PhotoDetailsState {
|
||||
final String error;
|
||||
|
||||
const PhotoDetailsFailure(this.error);
|
||||
final String error;
|
||||
|
||||
@override
|
||||
List<Object> get props => [error];
|
||||
|
||||
+1
-1
@@ -23,10 +23,10 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
part 'favorite_checker_state.dart';
|
||||
|
||||
class FavoriteCheckerCubit extends Cubit<FavoriteCheckerState> {
|
||||
final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites;
|
||||
|
||||
FavoriteCheckerCubit(this._checkIfPhotoIsInFavorites)
|
||||
: super(FavoriteCheckerInitial());
|
||||
final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites;
|
||||
|
||||
FutureOr<void> checkIfPhotoIsInFavorites(int photoId) async {
|
||||
final response = await _checkIfPhotoIsInFavorites.call(photoId);
|
||||
|
||||
+3
-3
@@ -10,19 +10,19 @@ abstract class FavoriteCheckerState extends Equatable {
|
||||
class FavoriteCheckerInitial extends FavoriteCheckerState {}
|
||||
|
||||
class FavoriteCheckerSuccess extends FavoriteCheckerState {
|
||||
final int photoId;
|
||||
final bool isFavorite;
|
||||
|
||||
const FavoriteCheckerSuccess(this.photoId, {required this.isFavorite});
|
||||
final int photoId;
|
||||
final bool isFavorite;
|
||||
|
||||
@override
|
||||
List<Object> get props => [photoId, isFavorite];
|
||||
}
|
||||
|
||||
class FavoriteCheckerFailure extends FavoriteCheckerState {
|
||||
final String error;
|
||||
|
||||
const FavoriteCheckerFailure(this.error);
|
||||
final String error;
|
||||
|
||||
@override
|
||||
List<Object> get props => [error];
|
||||
|
||||
+1
-1
@@ -33,7 +33,6 @@ EventTransformer<E> throttleDroppable<E>(Duration duration) =>
|
||||
(events, mapper) => droppable<E>().call(events.throttle(duration), mapper);
|
||||
|
||||
class PhotoBloc extends Bloc<PhotoEvent, PhotoState> {
|
||||
final OpenAlbum _openAlbum;
|
||||
|
||||
PhotoBloc(this._openAlbum) : super(const PhotoState()) {
|
||||
on<PhotoFetched>(
|
||||
@@ -41,6 +40,7 @@ class PhotoBloc extends Bloc<PhotoEvent, PhotoState> {
|
||||
transformer: throttleDroppable(throttleDuration),
|
||||
);
|
||||
}
|
||||
final OpenAlbum _openAlbum;
|
||||
|
||||
Future<void> _onPhotoFetched(
|
||||
PhotoFetched event,
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ abstract class PhotoEvent extends Equatable {
|
||||
}
|
||||
|
||||
class PhotoFetched extends PhotoEvent {
|
||||
final int albumId;
|
||||
|
||||
const PhotoFetched(this.albumId);
|
||||
final int albumId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user