feat: Add a small details bottom sheet

This commit is contained in:
2026-05-10 22:14:37 +02:00
parent 10b76ac214
commit c422d5c27c
14 changed files with 1752 additions and 2549 deletions

View File

@@ -11,72 +11,47 @@ part of 'anime_list_bloc.dart';
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$AnimeListState {
bool get buttonVisibility;
List<AnimeTrackingData> get animes;
List<MangaTrackingData> get mangas;
MediumTrackingState get animeFilterState;
MediumTrackingState get mangaFilterState;
TrackingMediumType get trackingType;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AnimeListStateCopyWith<AnimeListState> get copyWith =>
_$AnimeListStateCopyWithImpl<AnimeListState>(
this as AnimeListState, _$identity);
bool get buttonVisibility; List<AnimeTrackingData> get animes; List<MangaTrackingData> get mangas; MediumTrackingState get animeFilterState; MediumTrackingState get mangaFilterState; TrackingMediumType get trackingType;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AnimeListStateCopyWith<AnimeListState> get copyWith => _$AnimeListStateCopyWithImpl<AnimeListState>(this as AnimeListState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is AnimeListState &&
(identical(other.buttonVisibility, buttonVisibility) ||
other.buttonVisibility == buttonVisibility) &&
const DeepCollectionEquality().equals(other.animes, animes) &&
const DeepCollectionEquality().equals(other.mangas, mangas) &&
(identical(other.animeFilterState, animeFilterState) ||
other.animeFilterState == animeFilterState) &&
(identical(other.mangaFilterState, mangaFilterState) ||
other.mangaFilterState == mangaFilterState) &&
(identical(other.trackingType, trackingType) ||
other.trackingType == trackingType));
}
@override
int get hashCode => Object.hash(
runtimeType,
buttonVisibility,
const DeepCollectionEquality().hash(animes),
const DeepCollectionEquality().hash(mangas),
animeFilterState,
mangaFilterState,
trackingType);
@override
String toString() {
return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is AnimeListState&&(identical(other.buttonVisibility, buttonVisibility) || other.buttonVisibility == buttonVisibility)&&const DeepCollectionEquality().equals(other.animes, animes)&&const DeepCollectionEquality().equals(other.mangas, mangas)&&(identical(other.animeFilterState, animeFilterState) || other.animeFilterState == animeFilterState)&&(identical(other.mangaFilterState, mangaFilterState) || other.mangaFilterState == mangaFilterState)&&(identical(other.trackingType, trackingType) || other.trackingType == trackingType));
}
@override
int get hashCode => Object.hash(runtimeType,buttonVisibility,const DeepCollectionEquality().hash(animes),const DeepCollectionEquality().hash(mangas),animeFilterState,mangaFilterState,trackingType);
@override
String toString() {
return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)';
}
}
/// @nodoc
abstract mixin class $AnimeListStateCopyWith<$Res> {
factory $AnimeListStateCopyWith(
AnimeListState value, $Res Function(AnimeListState) _then) =
_$AnimeListStateCopyWithImpl;
@useResult
$Res call(
{bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType});
}
abstract mixin class $AnimeListStateCopyWith<$Res> {
factory $AnimeListStateCopyWith(AnimeListState value, $Res Function(AnimeListState) _then) = _$AnimeListStateCopyWithImpl;
@useResult
$Res call({
bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType
});
}
/// @nodoc
class _$AnimeListStateCopyWithImpl<$Res>
implements $AnimeListStateCopyWith<$Res> {
@@ -85,330 +60,216 @@ class _$AnimeListStateCopyWithImpl<$Res>
final AnimeListState _self;
final $Res Function(AnimeListState) _then;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? buttonVisibility = null,
Object? animes = null,
Object? mangas = null,
Object? animeFilterState = null,
Object? mangaFilterState = null,
Object? trackingType = null,
}) {
return _then(_self.copyWith(
buttonVisibility: null == buttonVisibility
? _self.buttonVisibility
: buttonVisibility // ignore: cast_nullable_to_non_nullable
as bool,
animes: null == animes
? _self.animes
: animes // ignore: cast_nullable_to_non_nullable
as List<AnimeTrackingData>,
mangas: null == mangas
? _self.mangas
: mangas // ignore: cast_nullable_to_non_nullable
as List<MangaTrackingData>,
animeFilterState: null == animeFilterState
? _self.animeFilterState
: animeFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
mangaFilterState: null == mangaFilterState
? _self.mangaFilterState
: mangaFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? buttonVisibility = null,Object? animes = null,Object? mangas = null,Object? animeFilterState = null,Object? mangaFilterState = null,Object? trackingType = null,}) {
return _then(_self.copyWith(
buttonVisibility: null == buttonVisibility ? _self.buttonVisibility : buttonVisibility // ignore: cast_nullable_to_non_nullable
as bool,animes: null == animes ? _self.animes : animes // ignore: cast_nullable_to_non_nullable
as List<AnimeTrackingData>,mangas: null == mangas ? _self.mangas : mangas // ignore: cast_nullable_to_non_nullable
as List<MangaTrackingData>,animeFilterState: null == animeFilterState ? _self.animeFilterState : animeFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,mangaFilterState: null == mangaFilterState ? _self.mangaFilterState : mangaFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
}
/// Adds pattern-matching-related methods to [AnimeListState].
extension AnimeListStatePatterns on AnimeListState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_AnimeListState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AnimeListState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_AnimeListState value) $default,
) {
final _that = this;
switch (_that) {
case _AnimeListState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AnimeListState value) $default,){
final _that = this;
switch (_that) {
case _AnimeListState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_AnimeListState value)? $default,
) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that);
case _:
return null;
}
}
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AnimeListState value)? $default,){
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that);case _:
return null;
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(
bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that.buttonVisibility,_that.animes,_that.mangas,_that.animeFilterState,_that.mangaFilterState,_that.trackingType);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(
bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType)
$default,
) {
final _that = this;
switch (_that) {
case _AnimeListState():
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType) $default,) {final _that = this;
switch (_that) {
case _AnimeListState():
return $default(_that.buttonVisibility,_that.animes,_that.mangas,_that.animeFilterState,_that.mangaFilterState,_that.trackingType);case _:
throw StateError('Unexpected subclass');
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType)? $default,) {final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that.buttonVisibility,_that.animes,_that.mangas,_that.animeFilterState,_that.mangaFilterState,_that.trackingType);case _:
return null;
}
}
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType)?
$default,
) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
case _:
return null;
}
}
}
/// @nodoc
class _AnimeListState implements AnimeListState {
_AnimeListState(
{this.buttonVisibility = true,
final List<AnimeTrackingData> animes = const [],
final List<MangaTrackingData> mangas = const [],
this.animeFilterState = MediumTrackingState.ongoing,
this.mangaFilterState = MediumTrackingState.ongoing,
this.trackingType = TrackingMediumType.anime})
: _animes = animes,
_mangas = mangas;
_AnimeListState({this.buttonVisibility = true, final List<AnimeTrackingData> animes = const [], final List<MangaTrackingData> mangas = const [], this.animeFilterState = MediumTrackingState.ongoing, this.mangaFilterState = MediumTrackingState.ongoing, this.trackingType = TrackingMediumType.anime}): _animes = animes,_mangas = mangas;
@override
@JsonKey()
final bool buttonVisibility;
final List<AnimeTrackingData> _animes;
@override
@JsonKey()
List<AnimeTrackingData> get animes {
if (_animes is EqualUnmodifiableListView) return _animes;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_animes);
}
@override@JsonKey() final bool buttonVisibility;
final List<AnimeTrackingData> _animes;
@override@JsonKey() List<AnimeTrackingData> get animes {
if (_animes is EqualUnmodifiableListView) return _animes;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_animes);
}
final List<MangaTrackingData> _mangas;
@override
@JsonKey()
List<MangaTrackingData> get mangas {
if (_mangas is EqualUnmodifiableListView) return _mangas;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_mangas);
}
final List<MangaTrackingData> _mangas;
@override@JsonKey() List<MangaTrackingData> get mangas {
if (_mangas is EqualUnmodifiableListView) return _mangas;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_mangas);
}
@override
@JsonKey()
final MediumTrackingState animeFilterState;
@override
@JsonKey()
final MediumTrackingState mangaFilterState;
@override
@JsonKey()
final TrackingMediumType trackingType;
@override@JsonKey() final MediumTrackingState animeFilterState;
@override@JsonKey() final MediumTrackingState mangaFilterState;
@override@JsonKey() final TrackingMediumType trackingType;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AnimeListStateCopyWith<_AnimeListState> get copyWith =>
__$AnimeListStateCopyWithImpl<_AnimeListState>(this, _$identity);
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AnimeListStateCopyWith<_AnimeListState> get copyWith => __$AnimeListStateCopyWithImpl<_AnimeListState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _AnimeListState &&
(identical(other.buttonVisibility, buttonVisibility) ||
other.buttonVisibility == buttonVisibility) &&
const DeepCollectionEquality().equals(other._animes, _animes) &&
const DeepCollectionEquality().equals(other._mangas, _mangas) &&
(identical(other.animeFilterState, animeFilterState) ||
other.animeFilterState == animeFilterState) &&
(identical(other.mangaFilterState, mangaFilterState) ||
other.mangaFilterState == mangaFilterState) &&
(identical(other.trackingType, trackingType) ||
other.trackingType == trackingType));
}
@override
int get hashCode => Object.hash(
runtimeType,
buttonVisibility,
const DeepCollectionEquality().hash(_animes),
const DeepCollectionEquality().hash(_mangas),
animeFilterState,
mangaFilterState,
trackingType);
@override
String toString() {
return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AnimeListState&&(identical(other.buttonVisibility, buttonVisibility) || other.buttonVisibility == buttonVisibility)&&const DeepCollectionEquality().equals(other._animes, _animes)&&const DeepCollectionEquality().equals(other._mangas, _mangas)&&(identical(other.animeFilterState, animeFilterState) || other.animeFilterState == animeFilterState)&&(identical(other.mangaFilterState, mangaFilterState) || other.mangaFilterState == mangaFilterState)&&(identical(other.trackingType, trackingType) || other.trackingType == trackingType));
}
@override
int get hashCode => Object.hash(runtimeType,buttonVisibility,const DeepCollectionEquality().hash(_animes),const DeepCollectionEquality().hash(_mangas),animeFilterState,mangaFilterState,trackingType);
@override
String toString() {
return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)';
}
}
/// @nodoc
abstract mixin class _$AnimeListStateCopyWith<$Res>
implements $AnimeListStateCopyWith<$Res> {
factory _$AnimeListStateCopyWith(
_AnimeListState value, $Res Function(_AnimeListState) _then) =
__$AnimeListStateCopyWithImpl;
@override
@useResult
$Res call(
{bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType});
}
abstract mixin class _$AnimeListStateCopyWith<$Res> implements $AnimeListStateCopyWith<$Res> {
factory _$AnimeListStateCopyWith(_AnimeListState value, $Res Function(_AnimeListState) _then) = __$AnimeListStateCopyWithImpl;
@override @useResult
$Res call({
bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType
});
}
/// @nodoc
class __$AnimeListStateCopyWithImpl<$Res>
implements _$AnimeListStateCopyWith<$Res> {
@@ -417,45 +278,21 @@ class __$AnimeListStateCopyWithImpl<$Res>
final _AnimeListState _self;
final $Res Function(_AnimeListState) _then;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? buttonVisibility = null,
Object? animes = null,
Object? mangas = null,
Object? animeFilterState = null,
Object? mangaFilterState = null,
Object? trackingType = null,
}) {
return _then(_AnimeListState(
buttonVisibility: null == buttonVisibility
? _self.buttonVisibility
: buttonVisibility // ignore: cast_nullable_to_non_nullable
as bool,
animes: null == animes
? _self._animes
: animes // ignore: cast_nullable_to_non_nullable
as List<AnimeTrackingData>,
mangas: null == mangas
? _self._mangas
: mangas // ignore: cast_nullable_to_non_nullable
as List<MangaTrackingData>,
animeFilterState: null == animeFilterState
? _self.animeFilterState
: animeFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
mangaFilterState: null == mangaFilterState
? _self.mangaFilterState
: mangaFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? buttonVisibility = null,Object? animes = null,Object? mangas = null,Object? animeFilterState = null,Object? mangaFilterState = null,Object? trackingType = null,}) {
return _then(_AnimeListState(
buttonVisibility: null == buttonVisibility ? _self.buttonVisibility : buttonVisibility // ignore: cast_nullable_to_non_nullable
as bool,animes: null == animes ? _self._animes : animes // ignore: cast_nullable_to_non_nullable
as List<AnimeTrackingData>,mangas: null == mangas ? _self._mangas : mangas // ignore: cast_nullable_to_non_nullable
as List<MangaTrackingData>,animeFilterState: null == animeFilterState ? _self.animeFilterState : animeFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,mangaFilterState: null == mangaFilterState ? _self.mangaFilterState : mangaFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
}
// dart format on

View File

@@ -11,59 +11,47 @@ part of 'anime_search_bloc.dart';
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$AnimeSearchState {
TrackingMediumType get trackingType;
String get searchQuery;
bool get working;
List<SearchResult> get searchResults;
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AnimeSearchStateCopyWith<AnimeSearchState> get copyWith =>
_$AnimeSearchStateCopyWithImpl<AnimeSearchState>(
this as AnimeSearchState, _$identity);
TrackingMediumType get trackingType; String get searchQuery; bool get working; List<SearchResult> get searchResults;
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AnimeSearchStateCopyWith<AnimeSearchState> get copyWith => _$AnimeSearchStateCopyWithImpl<AnimeSearchState>(this as AnimeSearchState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is AnimeSearchState &&
(identical(other.trackingType, trackingType) ||
other.trackingType == trackingType) &&
(identical(other.searchQuery, searchQuery) ||
other.searchQuery == searchQuery) &&
(identical(other.working, working) || other.working == working) &&
const DeepCollectionEquality()
.equals(other.searchResults, searchResults));
}
@override
int get hashCode => Object.hash(runtimeType, trackingType, searchQuery,
working, const DeepCollectionEquality().hash(searchResults));
@override
String toString() {
return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is AnimeSearchState&&(identical(other.trackingType, trackingType) || other.trackingType == trackingType)&&(identical(other.searchQuery, searchQuery) || other.searchQuery == searchQuery)&&(identical(other.working, working) || other.working == working)&&const DeepCollectionEquality().equals(other.searchResults, searchResults));
}
@override
int get hashCode => Object.hash(runtimeType,trackingType,searchQuery,working,const DeepCollectionEquality().hash(searchResults));
@override
String toString() {
return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)';
}
}
/// @nodoc
abstract mixin class $AnimeSearchStateCopyWith<$Res> {
factory $AnimeSearchStateCopyWith(
AnimeSearchState value, $Res Function(AnimeSearchState) _then) =
_$AnimeSearchStateCopyWithImpl;
@useResult
$Res call(
{TrackingMediumType trackingType,
String searchQuery,
bool working,
List<SearchResult> searchResults});
}
abstract mixin class $AnimeSearchStateCopyWith<$Res> {
factory $AnimeSearchStateCopyWith(AnimeSearchState value, $Res Function(AnimeSearchState) _then) = _$AnimeSearchStateCopyWithImpl;
@useResult
$Res call({
TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults
});
}
/// @nodoc
class _$AnimeSearchStateCopyWithImpl<$Res>
implements $AnimeSearchStateCopyWith<$Res> {
@@ -72,278 +60,206 @@ class _$AnimeSearchStateCopyWithImpl<$Res>
final AnimeSearchState _self;
final $Res Function(AnimeSearchState) _then;
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? trackingType = null,
Object? searchQuery = null,
Object? working = null,
Object? searchResults = null,
}) {
return _then(_self.copyWith(
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
searchQuery: null == searchQuery
? _self.searchQuery
: searchQuery // ignore: cast_nullable_to_non_nullable
as String,
working: null == working
? _self.working
: working // ignore: cast_nullable_to_non_nullable
as bool,
searchResults: null == searchResults
? _self.searchResults
: searchResults // ignore: cast_nullable_to_non_nullable
as List<SearchResult>,
));
}
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? trackingType = null,Object? searchQuery = null,Object? working = null,Object? searchResults = null,}) {
return _then(_self.copyWith(
trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,searchQuery: null == searchQuery ? _self.searchQuery : searchQuery // ignore: cast_nullable_to_non_nullable
as String,working: null == working ? _self.working : working // ignore: cast_nullable_to_non_nullable
as bool,searchResults: null == searchResults ? _self.searchResults : searchResults // ignore: cast_nullable_to_non_nullable
as List<SearchResult>,
));
}
}
/// Adds pattern-matching-related methods to [AnimeSearchState].
extension AnimeSearchStatePatterns on AnimeSearchState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_AnimeSearchState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AnimeSearchState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_AnimeSearchState value) $default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AnimeSearchState value) $default,){
final _that = this;
switch (_that) {
case _AnimeSearchState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_AnimeSearchState value)? $default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that);
case _:
return null;
}
}
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AnimeSearchState value)? $default,){
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that);case _:
return null;
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(TrackingMediumType trackingType, String searchQuery,
bool working, List<SearchResult> searchResults)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that.trackingType, _that.searchQuery, _that.working,
_that.searchResults);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that.trackingType,_that.searchQuery,_that.working,_that.searchResults);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(TrackingMediumType trackingType, String searchQuery,
bool working, List<SearchResult> searchResults)
$default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState():
return $default(_that.trackingType, _that.searchQuery, _that.working,
_that.searchResults);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults) $default,) {final _that = this;
switch (_that) {
case _AnimeSearchState():
return $default(_that.trackingType,_that.searchQuery,_that.working,_that.searchResults);case _:
throw StateError('Unexpected subclass');
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults)? $default,) {final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that.trackingType,_that.searchQuery,_that.working,_that.searchResults);case _:
return null;
}
}
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(TrackingMediumType trackingType, String searchQuery,
bool working, List<SearchResult> searchResults)?
$default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that.trackingType, _that.searchQuery, _that.working,
_that.searchResults);
case _:
return null;
}
}
}
/// @nodoc
class _AnimeSearchState implements AnimeSearchState {
_AnimeSearchState(
{this.trackingType = TrackingMediumType.anime,
this.searchQuery = '',
this.working = false,
final List<SearchResult> searchResults = const []})
: _searchResults = searchResults;
_AnimeSearchState({this.trackingType = TrackingMediumType.anime, this.searchQuery = '', this.working = false, final List<SearchResult> searchResults = const []}): _searchResults = searchResults;
@override
@JsonKey()
final TrackingMediumType trackingType;
@override
@JsonKey()
final String searchQuery;
@override
@JsonKey()
final bool working;
final List<SearchResult> _searchResults;
@override
@JsonKey()
List<SearchResult> get searchResults {
if (_searchResults is EqualUnmodifiableListView) return _searchResults;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_searchResults);
}
@override@JsonKey() final TrackingMediumType trackingType;
@override@JsonKey() final String searchQuery;
@override@JsonKey() final bool working;
final List<SearchResult> _searchResults;
@override@JsonKey() List<SearchResult> get searchResults {
if (_searchResults is EqualUnmodifiableListView) return _searchResults;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_searchResults);
}
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AnimeSearchStateCopyWith<_AnimeSearchState> get copyWith =>
__$AnimeSearchStateCopyWithImpl<_AnimeSearchState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _AnimeSearchState &&
(identical(other.trackingType, trackingType) ||
other.trackingType == trackingType) &&
(identical(other.searchQuery, searchQuery) ||
other.searchQuery == searchQuery) &&
(identical(other.working, working) || other.working == working) &&
const DeepCollectionEquality()
.equals(other._searchResults, _searchResults));
}
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AnimeSearchStateCopyWith<_AnimeSearchState> get copyWith => __$AnimeSearchStateCopyWithImpl<_AnimeSearchState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AnimeSearchState&&(identical(other.trackingType, trackingType) || other.trackingType == trackingType)&&(identical(other.searchQuery, searchQuery) || other.searchQuery == searchQuery)&&(identical(other.working, working) || other.working == working)&&const DeepCollectionEquality().equals(other._searchResults, _searchResults));
}
@override
int get hashCode => Object.hash(runtimeType,trackingType,searchQuery,working,const DeepCollectionEquality().hash(_searchResults));
@override
String toString() {
return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)';
}
@override
int get hashCode => Object.hash(runtimeType, trackingType, searchQuery,
working, const DeepCollectionEquality().hash(_searchResults));
@override
String toString() {
return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)';
}
}
/// @nodoc
abstract mixin class _$AnimeSearchStateCopyWith<$Res>
implements $AnimeSearchStateCopyWith<$Res> {
factory _$AnimeSearchStateCopyWith(
_AnimeSearchState value, $Res Function(_AnimeSearchState) _then) =
__$AnimeSearchStateCopyWithImpl;
@override
@useResult
$Res call(
{TrackingMediumType trackingType,
String searchQuery,
bool working,
List<SearchResult> searchResults});
}
abstract mixin class _$AnimeSearchStateCopyWith<$Res> implements $AnimeSearchStateCopyWith<$Res> {
factory _$AnimeSearchStateCopyWith(_AnimeSearchState value, $Res Function(_AnimeSearchState) _then) = __$AnimeSearchStateCopyWithImpl;
@override @useResult
$Res call({
TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults
});
}
/// @nodoc
class __$AnimeSearchStateCopyWithImpl<$Res>
implements _$AnimeSearchStateCopyWith<$Res> {
@@ -352,35 +268,19 @@ class __$AnimeSearchStateCopyWithImpl<$Res>
final _AnimeSearchState _self;
final $Res Function(_AnimeSearchState) _then;
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? trackingType = null,
Object? searchQuery = null,
Object? working = null,
Object? searchResults = null,
}) {
return _then(_AnimeSearchState(
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
searchQuery: null == searchQuery
? _self.searchQuery
: searchQuery // ignore: cast_nullable_to_non_nullable
as String,
working: null == working
? _self.working
: working // ignore: cast_nullable_to_non_nullable
as bool,
searchResults: null == searchResults
? _self._searchResults
: searchResults // ignore: cast_nullable_to_non_nullable
as List<SearchResult>,
));
}
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? trackingType = null,Object? searchQuery = null,Object? working = null,Object? searchResults = null,}) {
return _then(_AnimeSearchState(
trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,searchQuery: null == searchQuery ? _self.searchQuery : searchQuery // ignore: cast_nullable_to_non_nullable
as String,working: null == working ? _self.working : working // ignore: cast_nullable_to_non_nullable
as bool,searchResults: null == searchResults ? _self._searchResults : searchResults // ignore: cast_nullable_to_non_nullable
as List<SearchResult>,
));
}
}
// dart format on

View File

@@ -11,53 +11,47 @@ part of 'calendar_bloc.dart';
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$CalendarState {
bool get refreshing;
int get refreshingCount;
int get refreshingTotal;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$CalendarStateCopyWith<CalendarState> get copyWith =>
_$CalendarStateCopyWithImpl<CalendarState>(
this as CalendarState, _$identity);
bool get refreshing; int get refreshingCount; int get refreshingTotal;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$CalendarStateCopyWith<CalendarState> get copyWith => _$CalendarStateCopyWithImpl<CalendarState>(this as CalendarState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is CalendarState &&
(identical(other.refreshing, refreshing) ||
other.refreshing == refreshing) &&
(identical(other.refreshingCount, refreshingCount) ||
other.refreshingCount == refreshingCount) &&
(identical(other.refreshingTotal, refreshingTotal) ||
other.refreshingTotal == refreshingTotal));
}
@override
int get hashCode =>
Object.hash(runtimeType, refreshing, refreshingCount, refreshingTotal);
@override
String toString() {
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is CalendarState&&(identical(other.refreshing, refreshing) || other.refreshing == refreshing)&&(identical(other.refreshingCount, refreshingCount) || other.refreshingCount == refreshingCount)&&(identical(other.refreshingTotal, refreshingTotal) || other.refreshingTotal == refreshingTotal));
}
@override
int get hashCode => Object.hash(runtimeType,refreshing,refreshingCount,refreshingTotal);
@override
String toString() {
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
}
}
/// @nodoc
abstract mixin class $CalendarStateCopyWith<$Res> {
factory $CalendarStateCopyWith(
CalendarState value, $Res Function(CalendarState) _then) =
_$CalendarStateCopyWithImpl;
@useResult
$Res call({bool refreshing, int refreshingCount, int refreshingTotal});
}
abstract mixin class $CalendarStateCopyWith<$Res> {
factory $CalendarStateCopyWith(CalendarState value, $Res Function(CalendarState) _then) = _$CalendarStateCopyWithImpl;
@useResult
$Res call({
bool refreshing, int refreshingCount, int refreshingTotal
});
}
/// @nodoc
class _$CalendarStateCopyWithImpl<$Res>
implements $CalendarStateCopyWith<$Res> {
@@ -66,250 +60,198 @@ class _$CalendarStateCopyWithImpl<$Res>
final CalendarState _self;
final $Res Function(CalendarState) _then;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? refreshing = null,
Object? refreshingCount = null,
Object? refreshingTotal = null,
}) {
return _then(_self.copyWith(
refreshing: null == refreshing
? _self.refreshing
: refreshing // ignore: cast_nullable_to_non_nullable
as bool,
refreshingCount: null == refreshingCount
? _self.refreshingCount
: refreshingCount // ignore: cast_nullable_to_non_nullable
as int,
refreshingTotal: null == refreshingTotal
? _self.refreshingTotal
: refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? refreshing = null,Object? refreshingCount = null,Object? refreshingTotal = null,}) {
return _then(_self.copyWith(
refreshing: null == refreshing ? _self.refreshing : refreshing // ignore: cast_nullable_to_non_nullable
as bool,refreshingCount: null == refreshingCount ? _self.refreshingCount : refreshingCount // ignore: cast_nullable_to_non_nullable
as int,refreshingTotal: null == refreshingTotal ? _self.refreshingTotal : refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// Adds pattern-matching-related methods to [CalendarState].
extension CalendarStatePatterns on CalendarState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_CalendarState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _CalendarState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_CalendarState value) $default,
) {
final _that = this;
switch (_that) {
case _CalendarState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _CalendarState value) $default,){
final _that = this;
switch (_that) {
case _CalendarState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_CalendarState value)? $default,
) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that);
case _:
return null;
}
}
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _CalendarState value)? $default,){
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that);case _:
return null;
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(bool refreshing, int refreshingCount, int refreshingTotal)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool refreshing, int refreshingCount, int refreshingTotal)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that.refreshing,_that.refreshingCount,_that.refreshingTotal);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(bool refreshing, int refreshingCount, int refreshingTotal)
$default,
) {
final _that = this;
switch (_that) {
case _CalendarState():
return $default(
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool refreshing, int refreshingCount, int refreshingTotal) $default,) {final _that = this;
switch (_that) {
case _CalendarState():
return $default(_that.refreshing,_that.refreshingCount,_that.refreshingTotal);case _:
throw StateError('Unexpected subclass');
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool refreshing, int refreshingCount, int refreshingTotal)? $default,) {final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that.refreshing,_that.refreshingCount,_that.refreshingTotal);case _:
return null;
}
}
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
bool refreshing, int refreshingCount, int refreshingTotal)?
$default,
) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
case _:
return null;
}
}
}
/// @nodoc
class _CalendarState implements CalendarState {
_CalendarState(this.refreshing, this.refreshingCount, this.refreshingTotal);
_CalendarState(this.refreshing, this.refreshingCount, this.refreshingTotal);
@override
final bool refreshing;
@override
final int refreshingCount;
@override
final int refreshingTotal;
@override final bool refreshing;
@override final int refreshingCount;
@override final int refreshingTotal;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$CalendarStateCopyWith<_CalendarState> get copyWith =>
__$CalendarStateCopyWithImpl<_CalendarState>(this, _$identity);
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$CalendarStateCopyWith<_CalendarState> get copyWith => __$CalendarStateCopyWithImpl<_CalendarState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _CalendarState &&
(identical(other.refreshing, refreshing) ||
other.refreshing == refreshing) &&
(identical(other.refreshingCount, refreshingCount) ||
other.refreshingCount == refreshingCount) &&
(identical(other.refreshingTotal, refreshingTotal) ||
other.refreshingTotal == refreshingTotal));
}
@override
int get hashCode =>
Object.hash(runtimeType, refreshing, refreshingCount, refreshingTotal);
@override
String toString() {
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CalendarState&&(identical(other.refreshing, refreshing) || other.refreshing == refreshing)&&(identical(other.refreshingCount, refreshingCount) || other.refreshingCount == refreshingCount)&&(identical(other.refreshingTotal, refreshingTotal) || other.refreshingTotal == refreshingTotal));
}
@override
int get hashCode => Object.hash(runtimeType,refreshing,refreshingCount,refreshingTotal);
@override
String toString() {
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
}
}
/// @nodoc
abstract mixin class _$CalendarStateCopyWith<$Res>
implements $CalendarStateCopyWith<$Res> {
factory _$CalendarStateCopyWith(
_CalendarState value, $Res Function(_CalendarState) _then) =
__$CalendarStateCopyWithImpl;
@override
@useResult
$Res call({bool refreshing, int refreshingCount, int refreshingTotal});
}
abstract mixin class _$CalendarStateCopyWith<$Res> implements $CalendarStateCopyWith<$Res> {
factory _$CalendarStateCopyWith(_CalendarState value, $Res Function(_CalendarState) _then) = __$CalendarStateCopyWithImpl;
@override @useResult
$Res call({
bool refreshing, int refreshingCount, int refreshingTotal
});
}
/// @nodoc
class __$CalendarStateCopyWithImpl<$Res>
implements _$CalendarStateCopyWith<$Res> {
@@ -318,30 +260,18 @@ class __$CalendarStateCopyWithImpl<$Res>
final _CalendarState _self;
final $Res Function(_CalendarState) _then;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? refreshing = null,
Object? refreshingCount = null,
Object? refreshingTotal = null,
}) {
return _then(_CalendarState(
null == refreshing
? _self.refreshing
: refreshing // ignore: cast_nullable_to_non_nullable
as bool,
null == refreshingCount
? _self.refreshingCount
: refreshingCount // ignore: cast_nullable_to_non_nullable
as int,
null == refreshingTotal
? _self.refreshingTotal
: refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? refreshing = null,Object? refreshingCount = null,Object? refreshingTotal = null,}) {
return _then(_CalendarState(
null == refreshing ? _self.refreshing : refreshing // ignore: cast_nullable_to_non_nullable
as bool,null == refreshingCount ? _self.refreshingCount : refreshingCount // ignore: cast_nullable_to_non_nullable
as int,null == refreshingTotal ? _self.refreshingTotal : refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
// dart format on

View File

@@ -11,311 +11,247 @@ part of 'details_bloc.dart';
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$DetailsState {
TrackingMedium? get data;
String? get heroImagePrefix;
TrackingMediumType get trackingType;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$DetailsStateCopyWith<DetailsState> get copyWith =>
_$DetailsStateCopyWithImpl<DetailsState>(
this as DetailsState, _$identity);
TrackingMedium? get data; String? get heroImagePrefix; TrackingMediumType get trackingType;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$DetailsStateCopyWith<DetailsState> get copyWith => _$DetailsStateCopyWithImpl<DetailsState>(this as DetailsState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is DetailsState &&
(identical(other.data, data) || other.data == data) &&
(identical(other.heroImagePrefix, heroImagePrefix) ||
other.heroImagePrefix == heroImagePrefix) &&
(identical(other.trackingType, trackingType) ||
other.trackingType == trackingType));
}
@override
int get hashCode =>
Object.hash(runtimeType, data, heroImagePrefix, trackingType);
@override
String toString() {
return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is DetailsState&&(identical(other.data, data) || other.data == data)&&(identical(other.heroImagePrefix, heroImagePrefix) || other.heroImagePrefix == heroImagePrefix)&&(identical(other.trackingType, trackingType) || other.trackingType == trackingType));
}
@override
int get hashCode => Object.hash(runtimeType,data,heroImagePrefix,trackingType);
@override
String toString() {
return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)';
}
}
/// @nodoc
abstract mixin class $DetailsStateCopyWith<$Res> {
factory $DetailsStateCopyWith(
DetailsState value, $Res Function(DetailsState) _then) =
_$DetailsStateCopyWithImpl;
@useResult
$Res call(
{TrackingMedium? data,
String? heroImagePrefix,
TrackingMediumType trackingType});
}
abstract mixin class $DetailsStateCopyWith<$Res> {
factory $DetailsStateCopyWith(DetailsState value, $Res Function(DetailsState) _then) = _$DetailsStateCopyWithImpl;
@useResult
$Res call({
TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType
});
}
/// @nodoc
class _$DetailsStateCopyWithImpl<$Res> implements $DetailsStateCopyWith<$Res> {
class _$DetailsStateCopyWithImpl<$Res>
implements $DetailsStateCopyWith<$Res> {
_$DetailsStateCopyWithImpl(this._self, this._then);
final DetailsState _self;
final $Res Function(DetailsState) _then;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? data = freezed,
Object? heroImagePrefix = freezed,
Object? trackingType = null,
}) {
return _then(_self.copyWith(
data: freezed == data
? _self.data
: data // ignore: cast_nullable_to_non_nullable
as TrackingMedium?,
heroImagePrefix: freezed == heroImagePrefix
? _self.heroImagePrefix
: heroImagePrefix // ignore: cast_nullable_to_non_nullable
as String?,
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? data = freezed,Object? heroImagePrefix = freezed,Object? trackingType = null,}) {
return _then(_self.copyWith(
data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
as TrackingMedium?,heroImagePrefix: freezed == heroImagePrefix ? _self.heroImagePrefix : heroImagePrefix // ignore: cast_nullable_to_non_nullable
as String?,trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
}
/// Adds pattern-matching-related methods to [DetailsState].
extension DetailsStatePatterns on DetailsState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_DetailsState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _DetailsState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_DetailsState value) $default,
) {
final _that = this;
switch (_that) {
case _DetailsState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _DetailsState value) $default,){
final _that = this;
switch (_that) {
case _DetailsState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_DetailsState value)? $default,
) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that);
case _:
return null;
}
}
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _DetailsState value)? $default,){
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that);case _:
return null;
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(TrackingMedium? data, String? heroImagePrefix,
TrackingMediumType trackingType)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that.data,_that.heroImagePrefix,_that.trackingType);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(TrackingMedium? data, String? heroImagePrefix,
TrackingMediumType trackingType)
$default,
) {
final _that = this;
switch (_that) {
case _DetailsState():
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType) $default,) {final _that = this;
switch (_that) {
case _DetailsState():
return $default(_that.data,_that.heroImagePrefix,_that.trackingType);case _:
throw StateError('Unexpected subclass');
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType)? $default,) {final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that.data,_that.heroImagePrefix,_that.trackingType);case _:
return null;
}
}
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(TrackingMedium? data, String? heroImagePrefix,
TrackingMediumType trackingType)?
$default,
) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
case _:
return null;
}
}
}
/// @nodoc
class _DetailsState implements DetailsState {
_DetailsState(
{this.data,
this.heroImagePrefix,
this.trackingType = TrackingMediumType.anime});
_DetailsState({this.data, this.heroImagePrefix, this.trackingType = TrackingMediumType.anime});
@override
final TrackingMedium? data;
@override
final String? heroImagePrefix;
@override
@JsonKey()
final TrackingMediumType trackingType;
@override final TrackingMedium? data;
@override final String? heroImagePrefix;
@override@JsonKey() final TrackingMediumType trackingType;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$DetailsStateCopyWith<_DetailsState> get copyWith =>
__$DetailsStateCopyWithImpl<_DetailsState>(this, _$identity);
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$DetailsStateCopyWith<_DetailsState> get copyWith => __$DetailsStateCopyWithImpl<_DetailsState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _DetailsState &&
(identical(other.data, data) || other.data == data) &&
(identical(other.heroImagePrefix, heroImagePrefix) ||
other.heroImagePrefix == heroImagePrefix) &&
(identical(other.trackingType, trackingType) ||
other.trackingType == trackingType));
}
@override
int get hashCode =>
Object.hash(runtimeType, data, heroImagePrefix, trackingType);
@override
String toString() {
return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DetailsState&&(identical(other.data, data) || other.data == data)&&(identical(other.heroImagePrefix, heroImagePrefix) || other.heroImagePrefix == heroImagePrefix)&&(identical(other.trackingType, trackingType) || other.trackingType == trackingType));
}
@override
int get hashCode => Object.hash(runtimeType,data,heroImagePrefix,trackingType);
@override
String toString() {
return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)';
}
}
/// @nodoc
abstract mixin class _$DetailsStateCopyWith<$Res>
implements $DetailsStateCopyWith<$Res> {
factory _$DetailsStateCopyWith(
_DetailsState value, $Res Function(_DetailsState) _then) =
__$DetailsStateCopyWithImpl;
@override
@useResult
$Res call(
{TrackingMedium? data,
String? heroImagePrefix,
TrackingMediumType trackingType});
}
abstract mixin class _$DetailsStateCopyWith<$Res> implements $DetailsStateCopyWith<$Res> {
factory _$DetailsStateCopyWith(_DetailsState value, $Res Function(_DetailsState) _then) = __$DetailsStateCopyWithImpl;
@override @useResult
$Res call({
TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType
});
}
/// @nodoc
class __$DetailsStateCopyWithImpl<$Res>
implements _$DetailsStateCopyWith<$Res> {
@@ -324,30 +260,18 @@ class __$DetailsStateCopyWithImpl<$Res>
final _DetailsState _self;
final $Res Function(_DetailsState) _then;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? data = freezed,
Object? heroImagePrefix = freezed,
Object? trackingType = null,
}) {
return _then(_DetailsState(
data: freezed == data
? _self.data
: data // ignore: cast_nullable_to_non_nullable
as TrackingMedium?,
heroImagePrefix: freezed == heroImagePrefix
? _self.heroImagePrefix
: heroImagePrefix // ignore: cast_nullable_to_non_nullable
as String?,
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? data = freezed,Object? heroImagePrefix = freezed,Object? trackingType = null,}) {
return _then(_DetailsState(
data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
as TrackingMedium?,heroImagePrefix: freezed == heroImagePrefix ? _self.heroImagePrefix : heroImagePrefix // ignore: cast_nullable_to_non_nullable
as String?,trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
}
// dart format on

View File

@@ -11,53 +11,47 @@ part of 'settings_bloc.dart';
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$SettingsState {
bool get importSpinnerVisible;
int get importCurrent;
int get importTotal;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SettingsStateCopyWith<SettingsState> get copyWith =>
_$SettingsStateCopyWithImpl<SettingsState>(
this as SettingsState, _$identity);
bool get importSpinnerVisible; int get importCurrent; int get importTotal;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SettingsStateCopyWith<SettingsState> get copyWith => _$SettingsStateCopyWithImpl<SettingsState>(this as SettingsState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is SettingsState &&
(identical(other.importSpinnerVisible, importSpinnerVisible) ||
other.importSpinnerVisible == importSpinnerVisible) &&
(identical(other.importCurrent, importCurrent) ||
other.importCurrent == importCurrent) &&
(identical(other.importTotal, importTotal) ||
other.importTotal == importTotal));
}
@override
int get hashCode => Object.hash(
runtimeType, importSpinnerVisible, importCurrent, importTotal);
@override
String toString() {
return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is SettingsState&&(identical(other.importSpinnerVisible, importSpinnerVisible) || other.importSpinnerVisible == importSpinnerVisible)&&(identical(other.importCurrent, importCurrent) || other.importCurrent == importCurrent)&&(identical(other.importTotal, importTotal) || other.importTotal == importTotal));
}
@override
int get hashCode => Object.hash(runtimeType,importSpinnerVisible,importCurrent,importTotal);
@override
String toString() {
return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)';
}
}
/// @nodoc
abstract mixin class $SettingsStateCopyWith<$Res> {
factory $SettingsStateCopyWith(
SettingsState value, $Res Function(SettingsState) _then) =
_$SettingsStateCopyWithImpl;
@useResult
$Res call({bool importSpinnerVisible, int importCurrent, int importTotal});
}
abstract mixin class $SettingsStateCopyWith<$Res> {
factory $SettingsStateCopyWith(SettingsState value, $Res Function(SettingsState) _then) = _$SettingsStateCopyWithImpl;
@useResult
$Res call({
bool importSpinnerVisible, int importCurrent, int importTotal
});
}
/// @nodoc
class _$SettingsStateCopyWithImpl<$Res>
implements $SettingsStateCopyWith<$Res> {
@@ -66,258 +60,198 @@ class _$SettingsStateCopyWithImpl<$Res>
final SettingsState _self;
final $Res Function(SettingsState) _then;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? importSpinnerVisible = null,
Object? importCurrent = null,
Object? importTotal = null,
}) {
return _then(_self.copyWith(
importSpinnerVisible: null == importSpinnerVisible
? _self.importSpinnerVisible
: importSpinnerVisible // ignore: cast_nullable_to_non_nullable
as bool,
importCurrent: null == importCurrent
? _self.importCurrent
: importCurrent // ignore: cast_nullable_to_non_nullable
as int,
importTotal: null == importTotal
? _self.importTotal
: importTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? importSpinnerVisible = null,Object? importCurrent = null,Object? importTotal = null,}) {
return _then(_self.copyWith(
importSpinnerVisible: null == importSpinnerVisible ? _self.importSpinnerVisible : importSpinnerVisible // ignore: cast_nullable_to_non_nullable
as bool,importCurrent: null == importCurrent ? _self.importCurrent : importCurrent // ignore: cast_nullable_to_non_nullable
as int,importTotal: null == importTotal ? _self.importTotal : importTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// Adds pattern-matching-related methods to [SettingsState].
extension SettingsStatePatterns on SettingsState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_SettingsState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _SettingsState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_SettingsState value) $default,
) {
final _that = this;
switch (_that) {
case _SettingsState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _SettingsState value) $default,){
final _that = this;
switch (_that) {
case _SettingsState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_SettingsState value)? $default,
) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that);
case _:
return null;
}
}
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _SettingsState value)? $default,){
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that);case _:
return null;
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(
bool importSpinnerVisible, int importCurrent, int importTotal)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
case _:
return orElse();
}
}
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool importSpinnerVisible, int importCurrent, int importTotal)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that.importSpinnerVisible,_that.importCurrent,_that.importTotal);case _:
return orElse();
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(
bool importSpinnerVisible, int importCurrent, int importTotal)
$default,
) {
final _that = this;
switch (_that) {
case _SettingsState():
return $default(
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
case _:
throw StateError('Unexpected subclass');
}
}
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool importSpinnerVisible, int importCurrent, int importTotal) $default,) {final _that = this;
switch (_that) {
case _SettingsState():
return $default(_that.importSpinnerVisible,_that.importCurrent,_that.importTotal);case _:
throw StateError('Unexpected subclass');
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool importSpinnerVisible, int importCurrent, int importTotal)? $default,) {final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that.importSpinnerVisible,_that.importCurrent,_that.importTotal);case _:
return null;
}
}
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
bool importSpinnerVisible, int importCurrent, int importTotal)?
$default,
) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
case _:
return null;
}
}
}
/// @nodoc
class _SettingsState implements SettingsState {
_SettingsState(
{this.importSpinnerVisible = false,
this.importCurrent = 0,
this.importTotal = 0});
_SettingsState({this.importSpinnerVisible = false, this.importCurrent = 0, this.importTotal = 0});
@override
@JsonKey()
final bool importSpinnerVisible;
@override
@JsonKey()
final int importCurrent;
@override
@JsonKey()
final int importTotal;
@override@JsonKey() final bool importSpinnerVisible;
@override@JsonKey() final int importCurrent;
@override@JsonKey() final int importTotal;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SettingsStateCopyWith<_SettingsState> get copyWith =>
__$SettingsStateCopyWithImpl<_SettingsState>(this, _$identity);
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SettingsStateCopyWith<_SettingsState> get copyWith => __$SettingsStateCopyWithImpl<_SettingsState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _SettingsState &&
(identical(other.importSpinnerVisible, importSpinnerVisible) ||
other.importSpinnerVisible == importSpinnerVisible) &&
(identical(other.importCurrent, importCurrent) ||
other.importCurrent == importCurrent) &&
(identical(other.importTotal, importTotal) ||
other.importTotal == importTotal));
}
@override
int get hashCode => Object.hash(
runtimeType, importSpinnerVisible, importCurrent, importTotal);
@override
String toString() {
return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)';
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SettingsState&&(identical(other.importSpinnerVisible, importSpinnerVisible) || other.importSpinnerVisible == importSpinnerVisible)&&(identical(other.importCurrent, importCurrent) || other.importCurrent == importCurrent)&&(identical(other.importTotal, importTotal) || other.importTotal == importTotal));
}
@override
int get hashCode => Object.hash(runtimeType,importSpinnerVisible,importCurrent,importTotal);
@override
String toString() {
return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)';
}
}
/// @nodoc
abstract mixin class _$SettingsStateCopyWith<$Res>
implements $SettingsStateCopyWith<$Res> {
factory _$SettingsStateCopyWith(
_SettingsState value, $Res Function(_SettingsState) _then) =
__$SettingsStateCopyWithImpl;
@override
@useResult
$Res call({bool importSpinnerVisible, int importCurrent, int importTotal});
}
abstract mixin class _$SettingsStateCopyWith<$Res> implements $SettingsStateCopyWith<$Res> {
factory _$SettingsStateCopyWith(_SettingsState value, $Res Function(_SettingsState) _then) = __$SettingsStateCopyWithImpl;
@override @useResult
$Res call({
bool importSpinnerVisible, int importCurrent, int importTotal
});
}
/// @nodoc
class __$SettingsStateCopyWithImpl<$Res>
implements _$SettingsStateCopyWith<$Res> {
@@ -326,30 +260,18 @@ class __$SettingsStateCopyWithImpl<$Res>
final _SettingsState _self;
final $Res Function(_SettingsState) _then;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? importSpinnerVisible = null,
Object? importCurrent = null,
Object? importTotal = null,
}) {
return _then(_SettingsState(
importSpinnerVisible: null == importSpinnerVisible
? _self.importSpinnerVisible
: importSpinnerVisible // ignore: cast_nullable_to_non_nullable
as bool,
importCurrent: null == importCurrent
? _self.importCurrent
: importCurrent // ignore: cast_nullable_to_non_nullable
as int,
importTotal: null == importTotal
? _self.importTotal
: importTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? importSpinnerVisible = null,Object? importCurrent = null,Object? importTotal = null,}) {
return _then(_SettingsState(
importSpinnerVisible: null == importSpinnerVisible ? _self.importSpinnerVisible : importSpinnerVisible // ignore: cast_nullable_to_non_nullable
as bool,importCurrent: null == importCurrent ? _self.importCurrent : importCurrent // ignore: cast_nullable_to_non_nullable
as int,importTotal: null == importTotal ? _self.importTotal : importTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
// dart format on

View File

@@ -17,11 +17,11 @@ class DetailsPage extends StatelessWidget {
});
static MaterialPageRoute<dynamic> get route => MaterialPageRoute<dynamic>(
builder: (_) => const DetailsPage(),
settings: const RouteSettings(
name: detailsRoute,
),
);
builder: (_) => const DetailsPage(),
settings: const RouteSettings(
name: detailsRoute,
),
);
@override
Widget build(BuildContext context) {
@@ -56,66 +56,156 @@ class DetailsPage extends StatelessWidget {
Text(
state.data!.title,
textAlign: TextAlign.left,
style:
Theme.of(context).textTheme.titleLarge,
style: Theme.of(
context,
).textTheme.titleLarge,
maxLines: 2,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
ElevatedButton(
onPressed: () async {
final result = await showDialog<bool>(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
t.details.removeTitle(
title: state.data!.title,
),
),
content: Text(
t.details.removeBody(
title: state.data!.title,
),
),
actions: [
TextButton(
onPressed: () {
Navigator.of(context)
.pop(true);
},
style: TextButton.styleFrom(
foregroundColor: Colors.red,
),
child: Text(
t.details.removeButton,
),
),
TextButton(
onPressed: () {
Navigator.of(context)
.pop(false);
},
child: Text(
t.details.cancelButton,
),
),
],
);
},
);
Padding(
padding: const EdgeInsets.only(
top: 6,
),
child: Row(
spacing: 8,
children: [
ElevatedButton(
onPressed: () async {
final result = await showDialog<bool>(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
t.details.removeTitle(
title: state.data!.title,
),
),
content: Text(
t.details.removeBody(
title: state.data!.title,
),
),
actions: [
TextButton(
onPressed: () {
Navigator.of(
context,
).pop(true);
},
style:
TextButton.styleFrom(
foregroundColor:
Colors.red,
),
child: Text(
t.details.removeButton,
),
),
TextButton(
onPressed: () {
Navigator.of(
context,
).pop(false);
},
child: Text(
t.details.cancelButton,
),
),
],
);
},
);
if (result != true) return;
if (result != true) return;
// ignore: use_build_context_synchronously
context.read<DetailsBloc>().add(
ItemRemovedEvent(
state.data!.id,
state.trackingType,
),
);
},
child: const Icon(Icons.delete),
// ignore: use_build_context_synchronously
context.read<DetailsBloc>().add(
ItemRemovedEvent(
state.data!.id,
state.trackingType,
),
);
},
child: const Icon(
Icons.delete,
color: Colors.redAccent,
),
),
ElevatedButton(
onPressed: () async {
await showModalBottomSheet<void>(
context: context,
builder: (ctx) => DraggableScrollableSheet(
initialChildSize: 1,
builder: (ctx, scrollController) {
return Padding(
padding:
const EdgeInsetsGeometry.only(
top: 18,
),
child: ListView(
controller:
scrollController,
children: [
Padding(
padding:
const EdgeInsetsGeometry.directional(
start: 8,
end: 8,
),
child: Text(
t.details.details.titleJa,
style:
Theme.of(
context,
)
.textTheme
.headlineSmall,
),
),
Padding(
padding:
const EdgeInsetsGeometry.directional(
start: 8,
end: 8,
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.copy),
),
Expanded(
child: Padding(
padding: const EdgeInsetsGeometry.only(left: 8),
child: Text(
state
.data!
.title,
style: Theme.of(
context,
).textTheme.bodyLarge,
),
),
),
],
),
),
],
),
);
},
),
);
},
child: const Icon(
Icons.info,
),
),
],
),
),
],
),
@@ -135,50 +225,53 @@ class DetailsPage extends StatelessWidget {
if (state.trackingType ==
TrackingMediumType.anime) {
context.read<DetailsBloc>().add(
DetailsUpdatedEvent(
(state.data! as AnimeTrackingData)
.copyWith(
state: newState,
),
),
);
DetailsUpdatedEvent(
(state.data! as AnimeTrackingData).copyWith(
state: newState,
),
),
);
} else if (state.trackingType ==
TrackingMediumType.manga) {
context.read<DetailsBloc>().add(
DetailsUpdatedEvent(
(state.data! as MangaTrackingData)
.copyWith(
state: newState,
),
),
);
DetailsUpdatedEvent(
(state.data! as MangaTrackingData).copyWith(
state: newState,
),
),
);
}
},
values: [
SelectorItem(
MediumTrackingState.ongoing,
MediumTrackingState.ongoing
.getName(state.trackingType),
MediumTrackingState.ongoing.getName(
state.trackingType,
),
),
SelectorItem(
MediumTrackingState.completed,
MediumTrackingState.completed
.getName(state.trackingType),
MediumTrackingState.completed.getName(
state.trackingType,
),
),
SelectorItem(
MediumTrackingState.planned,
MediumTrackingState.planned
.getName(state.trackingType),
MediumTrackingState.planned.getName(
state.trackingType,
),
),
SelectorItem(
MediumTrackingState.dropped,
MediumTrackingState.dropped
.getName(state.trackingType),
MediumTrackingState.dropped.getName(
state.trackingType,
),
),
SelectorItem(
MediumTrackingState.paused,
MediumTrackingState.paused
.getName(state.trackingType),
MediumTrackingState.paused.getName(
state.trackingType,
),
),
],
initialValue: state.data!.state,
@@ -191,36 +284,36 @@ class DetailsPage extends StatelessWidget {
child: IntegerInput(
labelText:
state.trackingType == TrackingMediumType.anime
? t.details.episodes
: t.details.chapters,
? t.details.episodes
: t.details.chapters,
onChanged: (value) {
switch (state.trackingType) {
case TrackingMediumType.anime:
final data = state.data! as AnimeTrackingData;
context.read<DetailsBloc>().add(
DetailsUpdatedEvent(
data.copyWith(
episodesWatched: value,
),
),
);
DetailsUpdatedEvent(
data.copyWith(
episodesWatched: value,
),
),
);
break;
case TrackingMediumType.manga:
final data = state.data! as MangaTrackingData;
context.read<DetailsBloc>().add(
DetailsUpdatedEvent(
data.copyWith(
chaptersRead: value,
),
),
);
DetailsUpdatedEvent(
data.copyWith(
chaptersRead: value,
),
),
);
break;
}
},
initialValue: state.trackingType ==
TrackingMediumType.anime
initialValue:
state.trackingType == TrackingMediumType.anime
? (state.data! as AnimeTrackingData)
.episodesWatched
.episodesWatched
: (state.data! as MangaTrackingData).chaptersRead,
),
),
@@ -234,18 +327,17 @@ class DetailsPage extends StatelessWidget {
onChanged: (value) {
final data = state.data! as MangaTrackingData;
context.read<DetailsBloc>().add(
DetailsUpdatedEvent(
data.copyWith(
volumesOwned: value,
),
),
);
DetailsUpdatedEvent(
data.copyWith(
volumesOwned: value,
),
),
);
},
initialValue: (GetIt.I
.get<DetailsBloc>()
.state
.data! as MangaTrackingData)
.volumesOwned,
initialValue:
(GetIt.I.get<DetailsBloc>().state.data!
as MangaTrackingData)
.volumesOwned,
),
),
],