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

@@ -48,7 +48,10 @@
"readState": "Read state", "readState": "Read state",
"episodes": "Episodes", "episodes": "Episodes",
"chapters": "Chapters", "chapters": "Chapters",
"volumesOwned": "Volumes owned" "volumesOwned": "Volumes owned",
"details": {
"titleJa": "Japanese Title"
}
}, },
"calendar": { "calendar": {
"calendar": "Calendar", "calendar": "Calendar",

3
devtools_options.yaml Normal file
View File

@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:

View File

@@ -42,7 +42,7 @@ void main() async {
); );
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
LocaleSettings.useDeviceLocale(); await LocaleSettings.useDeviceLocale();
runApp( runApp(
MultiBlocProvider( MultiBlocProvider(

View File

@@ -14,90 +14,55 @@ T _$identity<T>(T value) => value;
/// @nodoc /// @nodoc
mixin _$AnimeTrackingData { mixin _$AnimeTrackingData {
/// The ID of the anime
String get id;
/// The state of the anime /// The ID of the anime
@MediumTrackingStateConverter() String get id;/// The state of the anime
MediumTrackingState get state; @MediumTrackingStateConverter() MediumTrackingState get state;/// The title of the anime
String get title;/// Episodes in total.
/// The title of the anime int get episodesWatched;/// Episodes watched.
String get title; int? get episodesTotal;/// URL to the thumbnail/cover art for the anime.
String get thumbnailUrl;/// Flag whether the anime is airing
/// Episodes in total. @BoolConverter() bool get airing;/// The day of the week the anime is airing
int get episodesWatched; String? get broadcastDay;
/// Create a copy of AnimeTrackingData
/// Episodes watched. /// with the given fields replaced by the non-null parameter values.
int? get episodesTotal; @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
/// URL to the thumbnail/cover art for the anime. $AnimeTrackingDataCopyWith<AnimeTrackingData> get copyWith => _$AnimeTrackingDataCopyWithImpl<AnimeTrackingData>(this as AnimeTrackingData, _$identity);
String get thumbnailUrl;
/// Flag whether the anime is airing
@BoolConverter()
bool get airing;
/// The day of the week the anime is airing
String? get broadcastDay;
/// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AnimeTrackingDataCopyWith<AnimeTrackingData> get copyWith =>
_$AnimeTrackingDataCopyWithImpl<AnimeTrackingData>(
this as AnimeTrackingData, _$identity);
/// Serializes this AnimeTrackingData to a JSON map. /// Serializes this AnimeTrackingData to a JSON map.
Map<String, dynamic> toJson(); Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is AnimeTrackingData &&
(identical(other.id, id) || other.id == id) &&
(identical(other.state, state) || other.state == state) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.episodesWatched, episodesWatched) ||
other.episodesWatched == episodesWatched) &&
(identical(other.episodesTotal, episodesTotal) ||
other.episodesTotal == episodesTotal) &&
(identical(other.thumbnailUrl, thumbnailUrl) ||
other.thumbnailUrl == thumbnailUrl) &&
(identical(other.airing, airing) || other.airing == airing) &&
(identical(other.broadcastDay, broadcastDay) ||
other.broadcastDay == broadcastDay));
}
@JsonKey(includeFromJson: false, includeToJson: false) @override
@override bool operator ==(Object other) {
int get hashCode => Object.hash(runtimeType, id, state, title, return identical(this, other) || (other.runtimeType == runtimeType&&other is AnimeTrackingData&&(identical(other.id, id) || other.id == id)&&(identical(other.state, state) || other.state == state)&&(identical(other.title, title) || other.title == title)&&(identical(other.episodesWatched, episodesWatched) || other.episodesWatched == episodesWatched)&&(identical(other.episodesTotal, episodesTotal) || other.episodesTotal == episodesTotal)&&(identical(other.thumbnailUrl, thumbnailUrl) || other.thumbnailUrl == thumbnailUrl)&&(identical(other.airing, airing) || other.airing == airing)&&(identical(other.broadcastDay, broadcastDay) || other.broadcastDay == broadcastDay));
episodesWatched, episodesTotal, thumbnailUrl, airing, broadcastDay); }
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,state,title,episodesWatched,episodesTotal,thumbnailUrl,airing,broadcastDay);
@override
String toString() {
return 'AnimeTrackingData(id: $id, state: $state, title: $title, episodesWatched: $episodesWatched, episodesTotal: $episodesTotal, thumbnailUrl: $thumbnailUrl, airing: $airing, broadcastDay: $broadcastDay)';
}
@override
String toString() {
return 'AnimeTrackingData(id: $id, state: $state, title: $title, episodesWatched: $episodesWatched, episodesTotal: $episodesTotal, thumbnailUrl: $thumbnailUrl, airing: $airing, broadcastDay: $broadcastDay)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class $AnimeTrackingDataCopyWith<$Res> { abstract mixin class $AnimeTrackingDataCopyWith<$Res> {
factory $AnimeTrackingDataCopyWith( factory $AnimeTrackingDataCopyWith(AnimeTrackingData value, $Res Function(AnimeTrackingData) _then) = _$AnimeTrackingDataCopyWithImpl;
AnimeTrackingData value, $Res Function(AnimeTrackingData) _then) = @useResult
_$AnimeTrackingDataCopyWithImpl; $Res call({
@useResult String id,@MediumTrackingStateConverter() MediumTrackingState state, String title, int episodesWatched, int? episodesTotal, String thumbnailUrl,@BoolConverter() bool airing, String? broadcastDay
$Res call( });
{String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int episodesWatched,
int? episodesTotal,
String thumbnailUrl,
@BoolConverter() bool airing,
String? broadcastDay});
}
}
/// @nodoc /// @nodoc
class _$AnimeTrackingDataCopyWithImpl<$Res> class _$AnimeTrackingDataCopyWithImpl<$Res>
implements $AnimeTrackingDataCopyWith<$Res> { implements $AnimeTrackingDataCopyWith<$Res> {
@@ -106,379 +71,219 @@ class _$AnimeTrackingDataCopyWithImpl<$Res>
final AnimeTrackingData _self; final AnimeTrackingData _self;
final $Res Function(AnimeTrackingData) _then; final $Res Function(AnimeTrackingData) _then;
/// Create a copy of AnimeTrackingData /// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? state = null,Object? title = null,Object? episodesWatched = null,Object? episodesTotal = freezed,Object? thumbnailUrl = null,Object? airing = null,Object? broadcastDay = freezed,}) {
@override return _then(_self.copyWith(
$Res call({ id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
Object? id = null, as String,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
Object? state = null, as MediumTrackingState,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
Object? title = null, as String,episodesWatched: null == episodesWatched ? _self.episodesWatched : episodesWatched // ignore: cast_nullable_to_non_nullable
Object? episodesWatched = null, as int,episodesTotal: freezed == episodesTotal ? _self.episodesTotal : episodesTotal // ignore: cast_nullable_to_non_nullable
Object? episodesTotal = freezed, as int?,thumbnailUrl: null == thumbnailUrl ? _self.thumbnailUrl : thumbnailUrl // ignore: cast_nullable_to_non_nullable
Object? thumbnailUrl = null, as String,airing: null == airing ? _self.airing : airing // ignore: cast_nullable_to_non_nullable
Object? airing = null, as bool,broadcastDay: freezed == broadcastDay ? _self.broadcastDay : broadcastDay // ignore: cast_nullable_to_non_nullable
Object? broadcastDay = freezed, as String?,
}) { ));
return _then(_self.copyWith(
id: null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as String,
state: null == state
? _self.state
: state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
title: null == title
? _self.title
: title // ignore: cast_nullable_to_non_nullable
as String,
episodesWatched: null == episodesWatched
? _self.episodesWatched
: episodesWatched // ignore: cast_nullable_to_non_nullable
as int,
episodesTotal: freezed == episodesTotal
? _self.episodesTotal
: episodesTotal // ignore: cast_nullable_to_non_nullable
as int?,
thumbnailUrl: null == thumbnailUrl
? _self.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String,
airing: null == airing
? _self.airing
: airing // ignore: cast_nullable_to_non_nullable
as bool,
broadcastDay: freezed == broadcastDay
? _self.broadcastDay
: broadcastDay // ignore: cast_nullable_to_non_nullable
as String?,
));
}
} }
}
/// Adds pattern-matching-related methods to [AnimeTrackingData]. /// Adds pattern-matching-related methods to [AnimeTrackingData].
extension AnimeTrackingDataPatterns on AnimeTrackingData { extension AnimeTrackingDataPatterns on AnimeTrackingData {
/// A variant of `map` that fallback to returning `orElse`. /// A variant of `map` that fallback to returning `orElse`.
/// ///
/// It is equivalent to doing: /// It is equivalent to doing:
/// ```dart /// ```dart
/// switch (sealedClass) { /// switch (sealedClass) {
/// case final Subclass value: /// case final Subclass value:
/// return ...; /// return ...;
/// case _: /// case _:
/// return orElse(); /// return orElse();
/// } /// }
/// ``` /// ```
@optionalTypeArgs @optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AnimeTrackingData value)? $default,{required TResult orElse(),}){
TResult maybeMap<TResult extends Object?>( final _that = this;
TResult Function(_AnimeTrackingData value)? $default, { switch (_that) {
required TResult orElse(), case _AnimeTrackingData() when $default != null:
}) { return $default(_that);case _:
final _that = this; return orElse();
switch (_that) {
case _AnimeTrackingData() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks. }
/// }
/// Callbacks receives the raw object, upcasted. /// A `switch`-like method, using callbacks.
/// It is equivalent to doing: ///
/// ```dart /// Callbacks receives the raw object, upcasted.
/// switch (sealedClass) { /// It is equivalent to doing:
/// case final Subclass value: /// ```dart
/// return ...; /// switch (sealedClass) {
/// case final Subclass2 value: /// case final Subclass value:
/// return ...; /// return ...;
/// } /// case final Subclass2 value:
/// ``` /// return ...;
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AnimeTrackingData value) $default,){
TResult map<TResult extends Object?>( final _that = this;
TResult Function(_AnimeTrackingData value) $default, switch (_that) {
) { case _AnimeTrackingData():
final _that = this; return $default(_that);case _:
switch (_that) { throw StateError('Unexpected subclass');
case _AnimeTrackingData():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`. }
/// }
/// It is equivalent to doing: /// A variant of `map` that fallback to returning `null`.
/// ```dart ///
/// switch (sealedClass) { /// It is equivalent to doing:
/// case final Subclass value: /// ```dart
/// return ...; /// switch (sealedClass) {
/// case _: /// case final Subclass value:
/// return null; /// return ...;
/// } /// case _:
/// ``` /// return null;
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AnimeTrackingData value)? $default,){
TResult? mapOrNull<TResult extends Object?>( final _that = this;
TResult? Function(_AnimeTrackingData value)? $default, switch (_that) {
) { case _AnimeTrackingData() when $default != null:
final _that = this; return $default(_that);case _:
switch (_that) { return null;
case _AnimeTrackingData() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback. }
/// }
/// It is equivalent to doing: /// A variant of `when` that fallback to an `orElse` callback.
/// ```dart ///
/// switch (sealedClass) { /// It is equivalent to doing:
/// case Subclass(:final field): /// ```dart
/// return ...; /// switch (sealedClass) {
/// case _: /// case Subclass(:final field):
/// return orElse(); /// return ...;
/// } /// case _:
/// ``` /// return orElse();
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, @MediumTrackingStateConverter() MediumTrackingState state, String title, int episodesWatched, int? episodesTotal, String thumbnailUrl, @BoolConverter() bool airing, String? broadcastDay)? $default,{required TResult orElse(),}) {final _that = this;
TResult maybeWhen<TResult extends Object?>( switch (_that) {
TResult Function( case _AnimeTrackingData() when $default != null:
String id, return $default(_that.id,_that.state,_that.title,_that.episodesWatched,_that.episodesTotal,_that.thumbnailUrl,_that.airing,_that.broadcastDay);case _:
@MediumTrackingStateConverter() MediumTrackingState state, return orElse();
String title,
int episodesWatched,
int? episodesTotal,
String thumbnailUrl,
@BoolConverter() bool airing,
String? broadcastDay)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeTrackingData() when $default != null:
return $default(
_that.id,
_that.state,
_that.title,
_that.episodesWatched,
_that.episodesTotal,
_that.thumbnailUrl,
_that.airing,
_that.broadcastDay);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks. }
/// }
/// As opposed to `map`, this offers destructuring. /// A `switch`-like method, using callbacks.
/// It is equivalent to doing: ///
/// ```dart /// As opposed to `map`, this offers destructuring.
/// switch (sealedClass) { /// It is equivalent to doing:
/// case Subclass(:final field): /// ```dart
/// return ...; /// switch (sealedClass) {
/// case Subclass2(:final field2): /// case Subclass(:final field):
/// return ...; /// return ...;
/// } /// case Subclass2(:final field2):
/// ``` /// return ...;
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, @MediumTrackingStateConverter() MediumTrackingState state, String title, int episodesWatched, int? episodesTotal, String thumbnailUrl, @BoolConverter() bool airing, String? broadcastDay) $default,) {final _that = this;
TResult when<TResult extends Object?>( switch (_that) {
TResult Function( case _AnimeTrackingData():
String id, return $default(_that.id,_that.state,_that.title,_that.episodesWatched,_that.episodesTotal,_that.thumbnailUrl,_that.airing,_that.broadcastDay);case _:
@MediumTrackingStateConverter() MediumTrackingState state, throw StateError('Unexpected subclass');
String title,
int episodesWatched,
int? episodesTotal,
String thumbnailUrl,
@BoolConverter() bool airing,
String? broadcastDay)
$default,
) {
final _that = this;
switch (_that) {
case _AnimeTrackingData():
return $default(
_that.id,
_that.state,
_that.title,
_that.episodesWatched,
_that.episodesTotal,
_that.thumbnailUrl,
_that.airing,
_that.broadcastDay);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null` }
/// }
/// It is equivalent to doing: /// A variant of `when` that fallback to returning `null`
/// ```dart ///
/// switch (sealedClass) { /// It is equivalent to doing:
/// case Subclass(:final field): /// ```dart
/// return ...; /// switch (sealedClass) {
/// case _: /// case Subclass(:final field):
/// return null; /// return ...;
/// } /// case _:
/// ``` /// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, @MediumTrackingStateConverter() MediumTrackingState state, String title, int episodesWatched, int? episodesTotal, String thumbnailUrl, @BoolConverter() bool airing, String? broadcastDay)? $default,) {final _that = this;
switch (_that) {
case _AnimeTrackingData() when $default != null:
return $default(_that.id,_that.state,_that.title,_that.episodesWatched,_that.episodesTotal,_that.thumbnailUrl,_that.airing,_that.broadcastDay);case _:
return null;
}
}
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int episodesWatched,
int? episodesTotal,
String thumbnailUrl,
@BoolConverter() bool airing,
String? broadcastDay)?
$default,
) {
final _that = this;
switch (_that) {
case _AnimeTrackingData() when $default != null:
return $default(
_that.id,
_that.state,
_that.title,
_that.episodesWatched,
_that.episodesTotal,
_that.thumbnailUrl,
_that.airing,
_that.broadcastDay);
case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _AnimeTrackingData extends AnimeTrackingData { class _AnimeTrackingData extends AnimeTrackingData {
_AnimeTrackingData( _AnimeTrackingData(this.id, @MediumTrackingStateConverter() this.state, this.title, this.episodesWatched, this.episodesTotal, this.thumbnailUrl, @BoolConverter() this.airing, this.broadcastDay): super._();
this.id, factory _AnimeTrackingData.fromJson(Map<String, dynamic> json) => _$AnimeTrackingDataFromJson(json);
@MediumTrackingStateConverter() this.state,
this.title,
this.episodesWatched,
this.episodesTotal,
this.thumbnailUrl,
@BoolConverter() this.airing,
this.broadcastDay)
: super._();
factory _AnimeTrackingData.fromJson(Map<String, dynamic> json) =>
_$AnimeTrackingDataFromJson(json);
/// The ID of the anime /// The ID of the anime
@override @override final String id;
final String id; /// The state of the anime
@override@MediumTrackingStateConverter() final MediumTrackingState state;
/// The title of the anime
@override final String title;
/// Episodes in total.
@override final int episodesWatched;
/// Episodes watched.
@override final int? episodesTotal;
/// URL to the thumbnail/cover art for the anime.
@override final String thumbnailUrl;
/// Flag whether the anime is airing
@override@BoolConverter() final bool airing;
/// The day of the week the anime is airing
@override final String? broadcastDay;
/// The state of the anime /// Create a copy of AnimeTrackingData
@override /// with the given fields replaced by the non-null parameter values.
@MediumTrackingStateConverter() @override @JsonKey(includeFromJson: false, includeToJson: false)
final MediumTrackingState state; @pragma('vm:prefer-inline')
_$AnimeTrackingDataCopyWith<_AnimeTrackingData> get copyWith => __$AnimeTrackingDataCopyWithImpl<_AnimeTrackingData>(this, _$identity);
/// The title of the anime @override
@override Map<String, dynamic> toJson() {
final String title; return _$AnimeTrackingDataToJson(this, );
}
/// Episodes in total. @override
@override bool operator ==(Object other) {
final int episodesWatched; return identical(this, other) || (other.runtimeType == runtimeType&&other is _AnimeTrackingData&&(identical(other.id, id) || other.id == id)&&(identical(other.state, state) || other.state == state)&&(identical(other.title, title) || other.title == title)&&(identical(other.episodesWatched, episodesWatched) || other.episodesWatched == episodesWatched)&&(identical(other.episodesTotal, episodesTotal) || other.episodesTotal == episodesTotal)&&(identical(other.thumbnailUrl, thumbnailUrl) || other.thumbnailUrl == thumbnailUrl)&&(identical(other.airing, airing) || other.airing == airing)&&(identical(other.broadcastDay, broadcastDay) || other.broadcastDay == broadcastDay));
}
/// Episodes watched. @JsonKey(includeFromJson: false, includeToJson: false)
@override @override
final int? episodesTotal; int get hashCode => Object.hash(runtimeType,id,state,title,episodesWatched,episodesTotal,thumbnailUrl,airing,broadcastDay);
/// URL to the thumbnail/cover art for the anime. @override
@override String toString() {
final String thumbnailUrl; return 'AnimeTrackingData(id: $id, state: $state, title: $title, episodesWatched: $episodesWatched, episodesTotal: $episodesTotal, thumbnailUrl: $thumbnailUrl, airing: $airing, broadcastDay: $broadcastDay)';
}
/// Flag whether the anime is airing
@override
@BoolConverter()
final bool airing;
/// The day of the week the anime is airing
@override
final String? broadcastDay;
/// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AnimeTrackingDataCopyWith<_AnimeTrackingData> get copyWith =>
__$AnimeTrackingDataCopyWithImpl<_AnimeTrackingData>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$AnimeTrackingDataToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _AnimeTrackingData &&
(identical(other.id, id) || other.id == id) &&
(identical(other.state, state) || other.state == state) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.episodesWatched, episodesWatched) ||
other.episodesWatched == episodesWatched) &&
(identical(other.episodesTotal, episodesTotal) ||
other.episodesTotal == episodesTotal) &&
(identical(other.thumbnailUrl, thumbnailUrl) ||
other.thumbnailUrl == thumbnailUrl) &&
(identical(other.airing, airing) || other.airing == airing) &&
(identical(other.broadcastDay, broadcastDay) ||
other.broadcastDay == broadcastDay));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, state, title,
episodesWatched, episodesTotal, thumbnailUrl, airing, broadcastDay);
@override
String toString() {
return 'AnimeTrackingData(id: $id, state: $state, title: $title, episodesWatched: $episodesWatched, episodesTotal: $episodesTotal, thumbnailUrl: $thumbnailUrl, airing: $airing, broadcastDay: $broadcastDay)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class _$AnimeTrackingDataCopyWith<$Res> abstract mixin class _$AnimeTrackingDataCopyWith<$Res> implements $AnimeTrackingDataCopyWith<$Res> {
implements $AnimeTrackingDataCopyWith<$Res> { factory _$AnimeTrackingDataCopyWith(_AnimeTrackingData value, $Res Function(_AnimeTrackingData) _then) = __$AnimeTrackingDataCopyWithImpl;
factory _$AnimeTrackingDataCopyWith( @override @useResult
_AnimeTrackingData value, $Res Function(_AnimeTrackingData) _then) = $Res call({
__$AnimeTrackingDataCopyWithImpl; String id,@MediumTrackingStateConverter() MediumTrackingState state, String title, int episodesWatched, int? episodesTotal, String thumbnailUrl,@BoolConverter() bool airing, String? broadcastDay
@override });
@useResult
$Res call(
{String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int episodesWatched,
int? episodesTotal,
String thumbnailUrl,
@BoolConverter() bool airing,
String? broadcastDay});
}
}
/// @nodoc /// @nodoc
class __$AnimeTrackingDataCopyWithImpl<$Res> class __$AnimeTrackingDataCopyWithImpl<$Res>
implements _$AnimeTrackingDataCopyWith<$Res> { implements _$AnimeTrackingDataCopyWith<$Res> {
@@ -487,55 +292,23 @@ class __$AnimeTrackingDataCopyWithImpl<$Res>
final _AnimeTrackingData _self; final _AnimeTrackingData _self;
final $Res Function(_AnimeTrackingData) _then; final $Res Function(_AnimeTrackingData) _then;
/// Create a copy of AnimeTrackingData /// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@override @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? state = null,Object? title = null,Object? episodesWatched = null,Object? episodesTotal = freezed,Object? thumbnailUrl = null,Object? airing = null,Object? broadcastDay = freezed,}) {
@pragma('vm:prefer-inline') return _then(_AnimeTrackingData(
$Res call({ null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
Object? id = null, as String,null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
Object? state = null, as MediumTrackingState,null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
Object? title = null, as String,null == episodesWatched ? _self.episodesWatched : episodesWatched // ignore: cast_nullable_to_non_nullable
Object? episodesWatched = null, as int,freezed == episodesTotal ? _self.episodesTotal : episodesTotal // ignore: cast_nullable_to_non_nullable
Object? episodesTotal = freezed, as int?,null == thumbnailUrl ? _self.thumbnailUrl : thumbnailUrl // ignore: cast_nullable_to_non_nullable
Object? thumbnailUrl = null, as String,null == airing ? _self.airing : airing // ignore: cast_nullable_to_non_nullable
Object? airing = null, as bool,freezed == broadcastDay ? _self.broadcastDay : broadcastDay // ignore: cast_nullable_to_non_nullable
Object? broadcastDay = freezed, as String?,
}) { ));
return _then(_AnimeTrackingData( }
null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as String,
null == state
? _self.state
: state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
null == title
? _self.title
: title // ignore: cast_nullable_to_non_nullable
as String,
null == episodesWatched
? _self.episodesWatched
: episodesWatched // ignore: cast_nullable_to_non_nullable
as int,
freezed == episodesTotal
? _self.episodesTotal
: episodesTotal // ignore: cast_nullable_to_non_nullable
as int?,
null == thumbnailUrl
? _self.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String,
null == airing
? _self.airing
: airing // ignore: cast_nullable_to_non_nullable
as bool,
freezed == broadcastDay
? _self.broadcastDay
: broadcastDay // ignore: cast_nullable_to_non_nullable
as String?,
));
}
} }
// dart format on // dart format on

View File

@@ -9,8 +9,9 @@ part of 'anime.dart';
_AnimeTrackingData _$AnimeTrackingDataFromJson(Map<String, dynamic> json) => _AnimeTrackingData _$AnimeTrackingDataFromJson(Map<String, dynamic> json) =>
_AnimeTrackingData( _AnimeTrackingData(
json['id'] as String, json['id'] as String,
const MediumTrackingStateConverter() const MediumTrackingStateConverter().fromJson(
.fromJson((json['state'] as num).toInt()), (json['state'] as num).toInt(),
),
json['title'] as String, json['title'] as String,
(json['episodesWatched'] as num).toInt(), (json['episodesWatched'] as num).toInt(),
(json['episodesTotal'] as num?)?.toInt(), (json['episodesTotal'] as num?)?.toInt(),

View File

@@ -14,84 +14,54 @@ T _$identity<T>(T value) => value;
/// @nodoc /// @nodoc
mixin _$MangaTrackingData { mixin _$MangaTrackingData {
/// The ID of the manga
String get id;
/// The state of the manga /// The ID of the manga
@MediumTrackingStateConverter() String get id;/// The state of the manga
MediumTrackingState get state; @MediumTrackingStateConverter() MediumTrackingState get state;/// The title of the manga
String get title;/// Chapters read.
/// The title of the manga int get chaptersRead;/// Chapters read.
String get title; int get volumesOwned;/// Episodes watched.
int? get chaptersTotal;/// URL to the thumbnail/cover art for the manga.
/// Chapters read. String get thumbnailUrl;
int get chaptersRead; /// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values.
/// Chapters read. @JsonKey(includeFromJson: false, includeToJson: false)
int get volumesOwned; @pragma('vm:prefer-inline')
$MangaTrackingDataCopyWith<MangaTrackingData> get copyWith => _$MangaTrackingDataCopyWithImpl<MangaTrackingData>(this as MangaTrackingData, _$identity);
/// Episodes watched.
int? get chaptersTotal;
/// URL to the thumbnail/cover art for the manga.
String get thumbnailUrl;
/// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$MangaTrackingDataCopyWith<MangaTrackingData> get copyWith =>
_$MangaTrackingDataCopyWithImpl<MangaTrackingData>(
this as MangaTrackingData, _$identity);
/// Serializes this MangaTrackingData to a JSON map. /// Serializes this MangaTrackingData to a JSON map.
Map<String, dynamic> toJson(); Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is MangaTrackingData &&
(identical(other.id, id) || other.id == id) &&
(identical(other.state, state) || other.state == state) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.chaptersRead, chaptersRead) ||
other.chaptersRead == chaptersRead) &&
(identical(other.volumesOwned, volumesOwned) ||
other.volumesOwned == volumesOwned) &&
(identical(other.chaptersTotal, chaptersTotal) ||
other.chaptersTotal == chaptersTotal) &&
(identical(other.thumbnailUrl, thumbnailUrl) ||
other.thumbnailUrl == thumbnailUrl));
}
@JsonKey(includeFromJson: false, includeToJson: false) @override
@override bool operator ==(Object other) {
int get hashCode => Object.hash(runtimeType, id, state, title, chaptersRead, return identical(this, other) || (other.runtimeType == runtimeType&&other is MangaTrackingData&&(identical(other.id, id) || other.id == id)&&(identical(other.state, state) || other.state == state)&&(identical(other.title, title) || other.title == title)&&(identical(other.chaptersRead, chaptersRead) || other.chaptersRead == chaptersRead)&&(identical(other.volumesOwned, volumesOwned) || other.volumesOwned == volumesOwned)&&(identical(other.chaptersTotal, chaptersTotal) || other.chaptersTotal == chaptersTotal)&&(identical(other.thumbnailUrl, thumbnailUrl) || other.thumbnailUrl == thumbnailUrl));
volumesOwned, chaptersTotal, thumbnailUrl); }
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,state,title,chaptersRead,volumesOwned,chaptersTotal,thumbnailUrl);
@override
String toString() {
return 'MangaTrackingData(id: $id, state: $state, title: $title, chaptersRead: $chaptersRead, volumesOwned: $volumesOwned, chaptersTotal: $chaptersTotal, thumbnailUrl: $thumbnailUrl)';
}
@override
String toString() {
return 'MangaTrackingData(id: $id, state: $state, title: $title, chaptersRead: $chaptersRead, volumesOwned: $volumesOwned, chaptersTotal: $chaptersTotal, thumbnailUrl: $thumbnailUrl)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class $MangaTrackingDataCopyWith<$Res> { abstract mixin class $MangaTrackingDataCopyWith<$Res> {
factory $MangaTrackingDataCopyWith( factory $MangaTrackingDataCopyWith(MangaTrackingData value, $Res Function(MangaTrackingData) _then) = _$MangaTrackingDataCopyWithImpl;
MangaTrackingData value, $Res Function(MangaTrackingData) _then) = @useResult
_$MangaTrackingDataCopyWithImpl; $Res call({
@useResult String id,@MediumTrackingStateConverter() MediumTrackingState state, String title, int chaptersRead, int volumesOwned, int? chaptersTotal, String thumbnailUrl
$Res call( });
{String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl});
}
}
/// @nodoc /// @nodoc
class _$MangaTrackingDataCopyWithImpl<$Res> class _$MangaTrackingDataCopyWithImpl<$Res>
implements $MangaTrackingDataCopyWith<$Res> { implements $MangaTrackingDataCopyWith<$Res> {
@@ -100,342 +70,216 @@ class _$MangaTrackingDataCopyWithImpl<$Res>
final MangaTrackingData _self; final MangaTrackingData _self;
final $Res Function(MangaTrackingData) _then; final $Res Function(MangaTrackingData) _then;
/// Create a copy of MangaTrackingData /// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? state = null,Object? title = null,Object? chaptersRead = null,Object? volumesOwned = null,Object? chaptersTotal = freezed,Object? thumbnailUrl = null,}) {
@override return _then(_self.copyWith(
$Res call({ id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
Object? id = null, as String,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
Object? state = null, as MediumTrackingState,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
Object? title = null, as String,chaptersRead: null == chaptersRead ? _self.chaptersRead : chaptersRead // ignore: cast_nullable_to_non_nullable
Object? chaptersRead = null, as int,volumesOwned: null == volumesOwned ? _self.volumesOwned : volumesOwned // ignore: cast_nullable_to_non_nullable
Object? volumesOwned = null, as int,chaptersTotal: freezed == chaptersTotal ? _self.chaptersTotal : chaptersTotal // ignore: cast_nullable_to_non_nullable
Object? chaptersTotal = freezed, as int?,thumbnailUrl: null == thumbnailUrl ? _self.thumbnailUrl : thumbnailUrl // ignore: cast_nullable_to_non_nullable
Object? thumbnailUrl = null, as String,
}) { ));
return _then(_self.copyWith(
id: null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as String,
state: null == state
? _self.state
: state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
title: null == title
? _self.title
: title // ignore: cast_nullable_to_non_nullable
as String,
chaptersRead: null == chaptersRead
? _self.chaptersRead
: chaptersRead // ignore: cast_nullable_to_non_nullable
as int,
volumesOwned: null == volumesOwned
? _self.volumesOwned
: volumesOwned // ignore: cast_nullable_to_non_nullable
as int,
chaptersTotal: freezed == chaptersTotal
? _self.chaptersTotal
: chaptersTotal // ignore: cast_nullable_to_non_nullable
as int?,
thumbnailUrl: null == thumbnailUrl
? _self.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String,
));
}
} }
}
/// Adds pattern-matching-related methods to [MangaTrackingData]. /// Adds pattern-matching-related methods to [MangaTrackingData].
extension MangaTrackingDataPatterns on MangaTrackingData { extension MangaTrackingDataPatterns on MangaTrackingData {
/// A variant of `map` that fallback to returning `orElse`. /// A variant of `map` that fallback to returning `orElse`.
/// ///
/// It is equivalent to doing: /// It is equivalent to doing:
/// ```dart /// ```dart
/// switch (sealedClass) { /// switch (sealedClass) {
/// case final Subclass value: /// case final Subclass value:
/// return ...; /// return ...;
/// case _: /// case _:
/// return orElse(); /// return orElse();
/// } /// }
/// ``` /// ```
@optionalTypeArgs @optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _MangaTrackingData value)? $default,{required TResult orElse(),}){
TResult maybeMap<TResult extends Object?>( final _that = this;
TResult Function(_MangaTrackingData value)? $default, { switch (_that) {
required TResult orElse(), case _MangaTrackingData() when $default != null:
}) { return $default(_that);case _:
final _that = this; return orElse();
switch (_that) {
case _MangaTrackingData() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks. }
/// }
/// Callbacks receives the raw object, upcasted. /// A `switch`-like method, using callbacks.
/// It is equivalent to doing: ///
/// ```dart /// Callbacks receives the raw object, upcasted.
/// switch (sealedClass) { /// It is equivalent to doing:
/// case final Subclass value: /// ```dart
/// return ...; /// switch (sealedClass) {
/// case final Subclass2 value: /// case final Subclass value:
/// return ...; /// return ...;
/// } /// case final Subclass2 value:
/// ``` /// return ...;
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _MangaTrackingData value) $default,){
TResult map<TResult extends Object?>( final _that = this;
TResult Function(_MangaTrackingData value) $default, switch (_that) {
) { case _MangaTrackingData():
final _that = this; return $default(_that);case _:
switch (_that) { throw StateError('Unexpected subclass');
case _MangaTrackingData():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`. }
/// }
/// It is equivalent to doing: /// A variant of `map` that fallback to returning `null`.
/// ```dart ///
/// switch (sealedClass) { /// It is equivalent to doing:
/// case final Subclass value: /// ```dart
/// return ...; /// switch (sealedClass) {
/// case _: /// case final Subclass value:
/// return null; /// return ...;
/// } /// case _:
/// ``` /// return null;
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _MangaTrackingData value)? $default,){
TResult? mapOrNull<TResult extends Object?>( final _that = this;
TResult? Function(_MangaTrackingData value)? $default, switch (_that) {
) { case _MangaTrackingData() when $default != null:
final _that = this; return $default(_that);case _:
switch (_that) { return null;
case _MangaTrackingData() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback. }
/// }
/// It is equivalent to doing: /// A variant of `when` that fallback to an `orElse` callback.
/// ```dart ///
/// switch (sealedClass) { /// It is equivalent to doing:
/// case Subclass(:final field): /// ```dart
/// return ...; /// switch (sealedClass) {
/// case _: /// case Subclass(:final field):
/// return orElse(); /// return ...;
/// } /// case _:
/// ``` /// return orElse();
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, @MediumTrackingStateConverter() MediumTrackingState state, String title, int chaptersRead, int volumesOwned, int? chaptersTotal, String thumbnailUrl)? $default,{required TResult orElse(),}) {final _that = this;
TResult maybeWhen<TResult extends Object?>( switch (_that) {
TResult Function( case _MangaTrackingData() when $default != null:
String id, return $default(_that.id,_that.state,_that.title,_that.chaptersRead,_that.volumesOwned,_that.chaptersTotal,_that.thumbnailUrl);case _:
@MediumTrackingStateConverter() MediumTrackingState state, return orElse();
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _MangaTrackingData() when $default != null:
return $default(_that.id, _that.state, _that.title, _that.chaptersRead,
_that.volumesOwned, _that.chaptersTotal, _that.thumbnailUrl);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks. }
/// }
/// As opposed to `map`, this offers destructuring. /// A `switch`-like method, using callbacks.
/// It is equivalent to doing: ///
/// ```dart /// As opposed to `map`, this offers destructuring.
/// switch (sealedClass) { /// It is equivalent to doing:
/// case Subclass(:final field): /// ```dart
/// return ...; /// switch (sealedClass) {
/// case Subclass2(:final field2): /// case Subclass(:final field):
/// return ...; /// return ...;
/// } /// case Subclass2(:final field2):
/// ``` /// return ...;
/// }
/// ```
@optionalTypeArgs @optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, @MediumTrackingStateConverter() MediumTrackingState state, String title, int chaptersRead, int volumesOwned, int? chaptersTotal, String thumbnailUrl) $default,) {final _that = this;
TResult when<TResult extends Object?>( switch (_that) {
TResult Function( case _MangaTrackingData():
String id, return $default(_that.id,_that.state,_that.title,_that.chaptersRead,_that.volumesOwned,_that.chaptersTotal,_that.thumbnailUrl);case _:
@MediumTrackingStateConverter() MediumTrackingState state, throw StateError('Unexpected subclass');
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl)
$default,
) {
final _that = this;
switch (_that) {
case _MangaTrackingData():
return $default(_that.id, _that.state, _that.title, _that.chaptersRead,
_that.volumesOwned, _that.chaptersTotal, _that.thumbnailUrl);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null` }
/// }
/// It is equivalent to doing: /// A variant of `when` that fallback to returning `null`
/// ```dart ///
/// switch (sealedClass) { /// It is equivalent to doing:
/// case Subclass(:final field): /// ```dart
/// return ...; /// switch (sealedClass) {
/// case _: /// case Subclass(:final field):
/// return null; /// return ...;
/// } /// case _:
/// ``` /// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, @MediumTrackingStateConverter() MediumTrackingState state, String title, int chaptersRead, int volumesOwned, int? chaptersTotal, String thumbnailUrl)? $default,) {final _that = this;
switch (_that) {
case _MangaTrackingData() when $default != null:
return $default(_that.id,_that.state,_that.title,_that.chaptersRead,_that.volumesOwned,_that.chaptersTotal,_that.thumbnailUrl);case _:
return null;
}
}
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl)?
$default,
) {
final _that = this;
switch (_that) {
case _MangaTrackingData() when $default != null:
return $default(_that.id, _that.state, _that.title, _that.chaptersRead,
_that.volumesOwned, _that.chaptersTotal, _that.thumbnailUrl);
case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _MangaTrackingData extends MangaTrackingData { class _MangaTrackingData extends MangaTrackingData {
_MangaTrackingData( _MangaTrackingData(this.id, @MediumTrackingStateConverter() this.state, this.title, this.chaptersRead, this.volumesOwned, this.chaptersTotal, this.thumbnailUrl): super._();
this.id, factory _MangaTrackingData.fromJson(Map<String, dynamic> json) => _$MangaTrackingDataFromJson(json);
@MediumTrackingStateConverter() this.state,
this.title,
this.chaptersRead,
this.volumesOwned,
this.chaptersTotal,
this.thumbnailUrl)
: super._();
factory _MangaTrackingData.fromJson(Map<String, dynamic> json) =>
_$MangaTrackingDataFromJson(json);
/// The ID of the manga /// The ID of the manga
@override @override final String id;
final String id; /// The state of the manga
@override@MediumTrackingStateConverter() final MediumTrackingState state;
/// The title of the manga
@override final String title;
/// Chapters read.
@override final int chaptersRead;
/// Chapters read.
@override final int volumesOwned;
/// Episodes watched.
@override final int? chaptersTotal;
/// URL to the thumbnail/cover art for the manga.
@override final String thumbnailUrl;
/// The state of the manga /// Create a copy of MangaTrackingData
@override /// with the given fields replaced by the non-null parameter values.
@MediumTrackingStateConverter() @override @JsonKey(includeFromJson: false, includeToJson: false)
final MediumTrackingState state; @pragma('vm:prefer-inline')
_$MangaTrackingDataCopyWith<_MangaTrackingData> get copyWith => __$MangaTrackingDataCopyWithImpl<_MangaTrackingData>(this, _$identity);
/// The title of the manga @override
@override Map<String, dynamic> toJson() {
final String title; return _$MangaTrackingDataToJson(this, );
}
/// Chapters read. @override
@override bool operator ==(Object other) {
final int chaptersRead; return identical(this, other) || (other.runtimeType == runtimeType&&other is _MangaTrackingData&&(identical(other.id, id) || other.id == id)&&(identical(other.state, state) || other.state == state)&&(identical(other.title, title) || other.title == title)&&(identical(other.chaptersRead, chaptersRead) || other.chaptersRead == chaptersRead)&&(identical(other.volumesOwned, volumesOwned) || other.volumesOwned == volumesOwned)&&(identical(other.chaptersTotal, chaptersTotal) || other.chaptersTotal == chaptersTotal)&&(identical(other.thumbnailUrl, thumbnailUrl) || other.thumbnailUrl == thumbnailUrl));
}
/// Chapters read. @JsonKey(includeFromJson: false, includeToJson: false)
@override @override
final int volumesOwned; int get hashCode => Object.hash(runtimeType,id,state,title,chaptersRead,volumesOwned,chaptersTotal,thumbnailUrl);
/// Episodes watched. @override
@override String toString() {
final int? chaptersTotal; return 'MangaTrackingData(id: $id, state: $state, title: $title, chaptersRead: $chaptersRead, volumesOwned: $volumesOwned, chaptersTotal: $chaptersTotal, thumbnailUrl: $thumbnailUrl)';
}
/// URL to the thumbnail/cover art for the manga.
@override
final String thumbnailUrl;
/// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$MangaTrackingDataCopyWith<_MangaTrackingData> get copyWith =>
__$MangaTrackingDataCopyWithImpl<_MangaTrackingData>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$MangaTrackingDataToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _MangaTrackingData &&
(identical(other.id, id) || other.id == id) &&
(identical(other.state, state) || other.state == state) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.chaptersRead, chaptersRead) ||
other.chaptersRead == chaptersRead) &&
(identical(other.volumesOwned, volumesOwned) ||
other.volumesOwned == volumesOwned) &&
(identical(other.chaptersTotal, chaptersTotal) ||
other.chaptersTotal == chaptersTotal) &&
(identical(other.thumbnailUrl, thumbnailUrl) ||
other.thumbnailUrl == thumbnailUrl));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, state, title, chaptersRead,
volumesOwned, chaptersTotal, thumbnailUrl);
@override
String toString() {
return 'MangaTrackingData(id: $id, state: $state, title: $title, chaptersRead: $chaptersRead, volumesOwned: $volumesOwned, chaptersTotal: $chaptersTotal, thumbnailUrl: $thumbnailUrl)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class _$MangaTrackingDataCopyWith<$Res> abstract mixin class _$MangaTrackingDataCopyWith<$Res> implements $MangaTrackingDataCopyWith<$Res> {
implements $MangaTrackingDataCopyWith<$Res> { factory _$MangaTrackingDataCopyWith(_MangaTrackingData value, $Res Function(_MangaTrackingData) _then) = __$MangaTrackingDataCopyWithImpl;
factory _$MangaTrackingDataCopyWith( @override @useResult
_MangaTrackingData value, $Res Function(_MangaTrackingData) _then) = $Res call({
__$MangaTrackingDataCopyWithImpl; String id,@MediumTrackingStateConverter() MediumTrackingState state, String title, int chaptersRead, int volumesOwned, int? chaptersTotal, String thumbnailUrl
@override });
@useResult
$Res call(
{String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl});
}
}
/// @nodoc /// @nodoc
class __$MangaTrackingDataCopyWithImpl<$Res> class __$MangaTrackingDataCopyWithImpl<$Res>
implements _$MangaTrackingDataCopyWith<$Res> { implements _$MangaTrackingDataCopyWith<$Res> {
@@ -444,50 +288,22 @@ class __$MangaTrackingDataCopyWithImpl<$Res>
final _MangaTrackingData _self; final _MangaTrackingData _self;
final $Res Function(_MangaTrackingData) _then; final $Res Function(_MangaTrackingData) _then;
/// Create a copy of MangaTrackingData /// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@override @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? state = null,Object? title = null,Object? chaptersRead = null,Object? volumesOwned = null,Object? chaptersTotal = freezed,Object? thumbnailUrl = null,}) {
@pragma('vm:prefer-inline') return _then(_MangaTrackingData(
$Res call({ null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
Object? id = null, as String,null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
Object? state = null, as MediumTrackingState,null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
Object? title = null, as String,null == chaptersRead ? _self.chaptersRead : chaptersRead // ignore: cast_nullable_to_non_nullable
Object? chaptersRead = null, as int,null == volumesOwned ? _self.volumesOwned : volumesOwned // ignore: cast_nullable_to_non_nullable
Object? volumesOwned = null, as int,freezed == chaptersTotal ? _self.chaptersTotal : chaptersTotal // ignore: cast_nullable_to_non_nullable
Object? chaptersTotal = freezed, as int?,null == thumbnailUrl ? _self.thumbnailUrl : thumbnailUrl // ignore: cast_nullable_to_non_nullable
Object? thumbnailUrl = null, as String,
}) { ));
return _then(_MangaTrackingData( }
null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as String,
null == state
? _self.state
: state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
null == title
? _self.title
: title // ignore: cast_nullable_to_non_nullable
as String,
null == chaptersRead
? _self.chaptersRead
: chaptersRead // ignore: cast_nullable_to_non_nullable
as int,
null == volumesOwned
? _self.volumesOwned
: volumesOwned // ignore: cast_nullable_to_non_nullable
as int,
freezed == chaptersTotal
? _self.chaptersTotal
: chaptersTotal // ignore: cast_nullable_to_non_nullable
as int?,
null == thumbnailUrl
? _self.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String,
));
}
} }
// dart format on // dart format on

View File

@@ -9,8 +9,9 @@ part of 'manga.dart';
_MangaTrackingData _$MangaTrackingDataFromJson(Map<String, dynamic> json) => _MangaTrackingData _$MangaTrackingDataFromJson(Map<String, dynamic> json) =>
_MangaTrackingData( _MangaTrackingData(
json['id'] as String, json['id'] as String,
const MediumTrackingStateConverter() const MediumTrackingStateConverter().fromJson(
.fromJson((json['state'] as num).toInt()), (json['state'] as num).toInt(),
),
json['title'] as String, json['title'] as String,
(json['chaptersRead'] as num).toInt(), (json['chaptersRead'] as num).toInt(),
(json['volumesOwned'] as num).toInt(), (json['volumesOwned'] as num).toInt(),

View File

@@ -4,7 +4,6 @@ import 'package:anitrack/src/data/anime.dart';
import 'package:anitrack/src/data/manga.dart'; import 'package:anitrack/src/data/manga.dart';
import 'package:anitrack/src/service/migrations/0000_airing.dart'; import 'package:anitrack/src/service/migrations/0000_airing.dart';
import 'package:anitrack/src/service/migrations/0000_score.dart'; import 'package:anitrack/src/service/migrations/0000_score.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart';
const animeTable = 'Anime'; const animeTable = 'Anime';
@@ -32,6 +31,7 @@ Future<void> _createDatabase(Database db, int version) async {
episodesWatched INTEGER NOT NULL, episodesWatched INTEGER NOT NULL,
thumbnailUrl TEXT NOT NULL, thumbnailUrl TEXT NOT NULL,
title TEXT NOT NULL, title TEXT NOT NULL,
otherTitles TEXT NOT NULL,
score INTEGER, score INTEGER,
airing INTEGER NOT NULL, airing INTEGER NOT NULL,
broadcastDay TEXT broadcastDay TEXT
@@ -40,14 +40,15 @@ Future<void> _createDatabase(Database db, int version) async {
await db.execute( await db.execute(
''' '''
CREATE TABLE $mangaTable( CREATE TABLE $mangaTable(
id TEXT NOT NULL PRIMARY KEY, id TEXT NOT NULL PRIMARY KEY,
state INTEGER NOT NULL, state INTEGER NOT NULL,
chaptersTotal INTEGER, chaptersTotal INTEGER,
chaptersRead INTEGER NOT NULL, chaptersRead INTEGER NOT NULL,
volumesOwned INTEGER NOT NULL, volumesOwned INTEGER NOT NULL,
thumbnailUrl TEXT NOT NULL, thumbnailUrl TEXT NOT NULL,
title TEXT NOT NULL, title TEXT NOT NULL,
score INTEGER otherTitles TEXT NOT NULL,
score INTEGER
)''', )''',
); );
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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