chore: fix and format using melos

This commit is contained in:
2023-02-23 19:19:48 +01:00
parent d098d9a6bf
commit 8d833d39d7
152 changed files with 441 additions and 468 deletions
@@ -23,7 +23,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
part 'favorite_checker_state.dart';
class FavoriteCheckerCubit extends Cubit<FavoriteCheckerState> {
FavoriteCheckerCubit(this._checkIfPhotoIsInFavorites)
: super(FavoriteCheckerInitial());
final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites;
@@ -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;
@@ -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> {
PhotoBloc(this._openAlbum) : super(const PhotoState()) {
on<PhotoFetched>(
_onPhotoFetched,
@@ -24,7 +24,6 @@ abstract class PhotoEvent extends Equatable {
}
class PhotoFetched extends PhotoEvent {
const PhotoFetched(this.albumId);
final int albumId;
}
@@ -71,17 +71,17 @@ class _PhotosGridState extends State<PhotosGrid> {
@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]),
);
}
@@ -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),
)
]
],
),