feat: Add a small details bottom sheet
This commit is contained in:
@@ -48,7 +48,10 @@
|
||||
"readState": "Read state",
|
||||
"episodes": "Episodes",
|
||||
"chapters": "Chapters",
|
||||
"volumesOwned": "Volumes owned"
|
||||
"volumesOwned": "Volumes owned",
|
||||
"details": {
|
||||
"titleJa": "Japanese Title"
|
||||
}
|
||||
},
|
||||
"calendar": {
|
||||
"calendar": "Calendar",
|
||||
|
||||
3
devtools_options.yaml
Normal file
3
devtools_options.yaml
Normal 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:
|
||||
@@ -42,7 +42,7 @@ void main() async {
|
||||
);
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
LocaleSettings.useDeviceLocale();
|
||||
await LocaleSettings.useDeviceLocale();
|
||||
|
||||
runApp(
|
||||
MultiBlocProvider(
|
||||
|
||||
@@ -14,90 +14,55 @@ T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AnimeTrackingData {
|
||||
|
||||
/// The ID of the anime
|
||||
String get id;
|
||||
|
||||
/// The state of the anime
|
||||
@MediumTrackingStateConverter()
|
||||
MediumTrackingState get state;
|
||||
|
||||
/// The title of the anime
|
||||
String get title;
|
||||
|
||||
/// Episodes in total.
|
||||
int get episodesWatched;
|
||||
|
||||
/// Episodes watched.
|
||||
int? get episodesTotal;
|
||||
|
||||
/// URL to the thumbnail/cover art for the anime.
|
||||
String get thumbnailUrl;
|
||||
|
||||
/// Flag whether the anime is airing
|
||||
@BoolConverter()
|
||||
bool get airing;
|
||||
|
||||
/// The day of the week the anime is airing
|
||||
String get id;/// The state of the anime
|
||||
@MediumTrackingStateConverter() MediumTrackingState get state;/// The title of the anime
|
||||
String get title;/// Episodes in total.
|
||||
int get episodesWatched;/// Episodes watched.
|
||||
int? get episodesTotal;/// URL to the thumbnail/cover art for the anime.
|
||||
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);
|
||||
$AnimeTrackingDataCopyWith<AnimeTrackingData> get copyWith => _$AnimeTrackingDataCopyWithImpl<AnimeTrackingData>(this as AnimeTrackingData, _$identity);
|
||||
|
||||
/// Serializes this AnimeTrackingData to a JSON map.
|
||||
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));
|
||||
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);
|
||||
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
|
||||
abstract mixin class $AnimeTrackingDataCopyWith<$Res> {
|
||||
factory $AnimeTrackingDataCopyWith(
|
||||
AnimeTrackingData value, $Res Function(AnimeTrackingData) _then) =
|
||||
_$AnimeTrackingDataCopyWithImpl;
|
||||
factory $AnimeTrackingDataCopyWith(AnimeTrackingData value, $Res Function(AnimeTrackingData) _then) = _$AnimeTrackingDataCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{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
|
||||
class _$AnimeTrackingDataCopyWithImpl<$Res>
|
||||
implements $AnimeTrackingDataCopyWith<$Res> {
|
||||
@@ -108,55 +73,23 @@ class _$AnimeTrackingDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of AnimeTrackingData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@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,
|
||||
}) {
|
||||
@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,}) {
|
||||
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
|
||||
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].
|
||||
extension AnimeTrackingDataPatterns on AnimeTrackingData {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
@@ -171,20 +104,15 @@ extension AnimeTrackingDataPatterns on AnimeTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AnimeTrackingData value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AnimeTrackingData value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeTrackingData() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
@@ -198,19 +126,15 @@ extension AnimeTrackingDataPatterns on AnimeTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AnimeTrackingData value) $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AnimeTrackingData value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeTrackingData():
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -223,19 +147,15 @@ extension AnimeTrackingDataPatterns on AnimeTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AnimeTrackingData value)? $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AnimeTrackingData value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeTrackingData() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -248,37 +168,14 @@ extension AnimeTrackingDataPatterns on AnimeTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@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;
|
||||
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 $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.
|
||||
@@ -292,36 +189,14 @@ extension AnimeTrackingDataPatterns on AnimeTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@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;
|
||||
switch (_that) {
|
||||
case _AnimeTrackingData():
|
||||
return $default(
|
||||
_that.id,
|
||||
_that.state,
|
||||
_that.title,
|
||||
_that.episodesWatched,
|
||||
_that.episodesTotal,
|
||||
_that.thumbnailUrl,
|
||||
_that.airing,
|
||||
_that.broadcastDay);
|
||||
case _:
|
||||
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:
|
||||
@@ -334,151 +209,81 @@ extension AnimeTrackingDataPatterns on AnimeTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@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 $default(_that.id,_that.state,_that.title,_that.episodesWatched,_that.episodesTotal,_that.thumbnailUrl,_that.airing,_that.broadcastDay);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _AnimeTrackingData extends AnimeTrackingData {
|
||||
_AnimeTrackingData(
|
||||
this.id,
|
||||
@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);
|
||||
_AnimeTrackingData(this.id, @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
|
||||
@override
|
||||
final String id;
|
||||
|
||||
@override final String id;
|
||||
/// The state of the anime
|
||||
@override
|
||||
@MediumTrackingStateConverter()
|
||||
final MediumTrackingState state;
|
||||
|
||||
@override@MediumTrackingStateConverter() final MediumTrackingState state;
|
||||
/// The title of the anime
|
||||
@override
|
||||
final String title;
|
||||
|
||||
@override final String title;
|
||||
/// Episodes in total.
|
||||
@override
|
||||
final int episodesWatched;
|
||||
|
||||
@override final int episodesWatched;
|
||||
/// Episodes watched.
|
||||
@override
|
||||
final int? episodesTotal;
|
||||
|
||||
@override final int? episodesTotal;
|
||||
/// URL to the thumbnail/cover art for the anime.
|
||||
@override
|
||||
final String thumbnailUrl;
|
||||
|
||||
@override final String thumbnailUrl;
|
||||
/// Flag whether the anime is airing
|
||||
@override
|
||||
@BoolConverter()
|
||||
final bool airing;
|
||||
|
||||
@override@BoolConverter() final bool airing;
|
||||
/// The day of the week the anime is airing
|
||||
@override
|
||||
final String? broadcastDay;
|
||||
@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)
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$AnimeTrackingDataCopyWith<_AnimeTrackingData> get copyWith =>
|
||||
__$AnimeTrackingDataCopyWithImpl<_AnimeTrackingData>(this, _$identity);
|
||||
_$AnimeTrackingDataCopyWith<_AnimeTrackingData> get copyWith => __$AnimeTrackingDataCopyWithImpl<_AnimeTrackingData>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$AnimeTrackingDataToJson(
|
||||
this,
|
||||
);
|
||||
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));
|
||||
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);
|
||||
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
|
||||
abstract mixin class _$AnimeTrackingDataCopyWith<$Res>
|
||||
implements $AnimeTrackingDataCopyWith<$Res> {
|
||||
factory _$AnimeTrackingDataCopyWith(
|
||||
_AnimeTrackingData value, $Res Function(_AnimeTrackingData) _then) =
|
||||
__$AnimeTrackingDataCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
@MediumTrackingStateConverter() MediumTrackingState state,
|
||||
String title,
|
||||
int episodesWatched,
|
||||
int? episodesTotal,
|
||||
String thumbnailUrl,
|
||||
@BoolConverter() bool airing,
|
||||
String? broadcastDay});
|
||||
}
|
||||
abstract mixin class _$AnimeTrackingDataCopyWith<$Res> implements $AnimeTrackingDataCopyWith<$Res> {
|
||||
factory _$AnimeTrackingDataCopyWith(_AnimeTrackingData value, $Res Function(_AnimeTrackingData) _then) = __$AnimeTrackingDataCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String id,@MediumTrackingStateConverter() MediumTrackingState state, String title, int episodesWatched, int? episodesTotal, String thumbnailUrl,@BoolConverter() bool airing, String? broadcastDay
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$AnimeTrackingDataCopyWithImpl<$Res>
|
||||
implements _$AnimeTrackingDataCopyWith<$Res> {
|
||||
@@ -489,53 +294,21 @@ class __$AnimeTrackingDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of AnimeTrackingData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@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,
|
||||
}) {
|
||||
@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,}) {
|
||||
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
|
||||
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
|
||||
|
||||
@@ -9,8 +9,9 @@ part of 'anime.dart';
|
||||
_AnimeTrackingData _$AnimeTrackingDataFromJson(Map<String, dynamic> json) =>
|
||||
_AnimeTrackingData(
|
||||
json['id'] as String,
|
||||
const MediumTrackingStateConverter()
|
||||
.fromJson((json['state'] as num).toInt()),
|
||||
const MediumTrackingStateConverter().fromJson(
|
||||
(json['state'] as num).toInt(),
|
||||
),
|
||||
json['title'] as String,
|
||||
(json['episodesWatched'] as num).toInt(),
|
||||
(json['episodesTotal'] as num?)?.toInt(),
|
||||
|
||||
@@ -14,84 +14,54 @@ T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$MangaTrackingData {
|
||||
|
||||
/// The ID of the manga
|
||||
String get id;
|
||||
|
||||
/// The state of the manga
|
||||
@MediumTrackingStateConverter()
|
||||
MediumTrackingState get state;
|
||||
|
||||
/// The title of the manga
|
||||
String get title;
|
||||
|
||||
/// Chapters read.
|
||||
int get chaptersRead;
|
||||
|
||||
/// Chapters read.
|
||||
int get volumesOwned;
|
||||
|
||||
/// Episodes watched.
|
||||
int? get chaptersTotal;
|
||||
|
||||
/// URL to the thumbnail/cover art for the manga.
|
||||
String get id;/// The state of the manga
|
||||
@MediumTrackingStateConverter() MediumTrackingState get state;/// The title of the manga
|
||||
String get title;/// Chapters read.
|
||||
int get chaptersRead;/// Chapters read.
|
||||
int get volumesOwned;/// 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);
|
||||
$MangaTrackingDataCopyWith<MangaTrackingData> get copyWith => _$MangaTrackingDataCopyWithImpl<MangaTrackingData>(this as MangaTrackingData, _$identity);
|
||||
|
||||
/// Serializes this MangaTrackingData to a JSON map.
|
||||
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));
|
||||
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);
|
||||
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
|
||||
abstract mixin class $MangaTrackingDataCopyWith<$Res> {
|
||||
factory $MangaTrackingDataCopyWith(
|
||||
MangaTrackingData value, $Res Function(MangaTrackingData) _then) =
|
||||
_$MangaTrackingDataCopyWithImpl;
|
||||
factory $MangaTrackingDataCopyWith(MangaTrackingData value, $Res Function(MangaTrackingData) _then) = _$MangaTrackingDataCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{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
|
||||
class _$MangaTrackingDataCopyWithImpl<$Res>
|
||||
implements $MangaTrackingDataCopyWith<$Res> {
|
||||
@@ -102,50 +72,22 @@ class _$MangaTrackingDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of MangaTrackingData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@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,
|
||||
}) {
|
||||
@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,}) {
|
||||
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
|
||||
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].
|
||||
extension MangaTrackingDataPatterns on MangaTrackingData {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
@@ -160,20 +102,15 @@ extension MangaTrackingDataPatterns on MangaTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_MangaTrackingData value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _MangaTrackingData value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MangaTrackingData() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
@@ -187,19 +124,15 @@ extension MangaTrackingDataPatterns on MangaTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_MangaTrackingData value) $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _MangaTrackingData value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MangaTrackingData():
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -212,19 +145,15 @@ extension MangaTrackingDataPatterns on MangaTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_MangaTrackingData value)? $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _MangaTrackingData value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MangaTrackingData() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -237,29 +166,14 @@ extension MangaTrackingDataPatterns on MangaTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@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;
|
||||
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 $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.
|
||||
@@ -273,28 +187,14 @@ extension MangaTrackingDataPatterns on MangaTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@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;
|
||||
switch (_that) {
|
||||
case _MangaTrackingData():
|
||||
return $default(_that.id, _that.state, _that.title, _that.chaptersRead,
|
||||
_that.volumesOwned, _that.chaptersTotal, _that.thumbnailUrl);
|
||||
case _:
|
||||
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:
|
||||
@@ -307,135 +207,79 @@ extension MangaTrackingDataPatterns on MangaTrackingData {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@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 $default(_that.id,_that.state,_that.title,_that.chaptersRead,_that.volumesOwned,_that.chaptersTotal,_that.thumbnailUrl);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _MangaTrackingData extends MangaTrackingData {
|
||||
_MangaTrackingData(
|
||||
this.id,
|
||||
@MediumTrackingStateConverter() this.state,
|
||||
this.title,
|
||||
this.chaptersRead,
|
||||
this.volumesOwned,
|
||||
this.chaptersTotal,
|
||||
this.thumbnailUrl)
|
||||
: super._();
|
||||
factory _MangaTrackingData.fromJson(Map<String, dynamic> json) =>
|
||||
_$MangaTrackingDataFromJson(json);
|
||||
_MangaTrackingData(this.id, @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
|
||||
@override
|
||||
final String id;
|
||||
|
||||
@override final String id;
|
||||
/// The state of the manga
|
||||
@override
|
||||
@MediumTrackingStateConverter()
|
||||
final MediumTrackingState state;
|
||||
|
||||
@override@MediumTrackingStateConverter() final MediumTrackingState state;
|
||||
/// The title of the manga
|
||||
@override
|
||||
final String title;
|
||||
|
||||
@override final String title;
|
||||
/// Chapters read.
|
||||
@override
|
||||
final int chaptersRead;
|
||||
|
||||
@override final int chaptersRead;
|
||||
/// Chapters read.
|
||||
@override
|
||||
final int volumesOwned;
|
||||
|
||||
@override final int volumesOwned;
|
||||
/// Episodes watched.
|
||||
@override
|
||||
final int? chaptersTotal;
|
||||
|
||||
@override final int? chaptersTotal;
|
||||
/// URL to the thumbnail/cover art for the manga.
|
||||
@override
|
||||
final String thumbnailUrl;
|
||||
@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)
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$MangaTrackingDataCopyWith<_MangaTrackingData> get copyWith =>
|
||||
__$MangaTrackingDataCopyWithImpl<_MangaTrackingData>(this, _$identity);
|
||||
_$MangaTrackingDataCopyWith<_MangaTrackingData> get copyWith => __$MangaTrackingDataCopyWithImpl<_MangaTrackingData>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$MangaTrackingDataToJson(
|
||||
this,
|
||||
);
|
||||
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));
|
||||
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);
|
||||
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
|
||||
abstract mixin class _$MangaTrackingDataCopyWith<$Res>
|
||||
implements $MangaTrackingDataCopyWith<$Res> {
|
||||
factory _$MangaTrackingDataCopyWith(
|
||||
_MangaTrackingData value, $Res Function(_MangaTrackingData) _then) =
|
||||
__$MangaTrackingDataCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
@MediumTrackingStateConverter() MediumTrackingState state,
|
||||
String title,
|
||||
int chaptersRead,
|
||||
int volumesOwned,
|
||||
int? chaptersTotal,
|
||||
String thumbnailUrl});
|
||||
}
|
||||
abstract mixin class _$MangaTrackingDataCopyWith<$Res> implements $MangaTrackingDataCopyWith<$Res> {
|
||||
factory _$MangaTrackingDataCopyWith(_MangaTrackingData value, $Res Function(_MangaTrackingData) _then) = __$MangaTrackingDataCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String id,@MediumTrackingStateConverter() MediumTrackingState state, String title, int chaptersRead, int volumesOwned, int? chaptersTotal, String thumbnailUrl
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$MangaTrackingDataCopyWithImpl<$Res>
|
||||
implements _$MangaTrackingDataCopyWith<$Res> {
|
||||
@@ -446,48 +290,20 @@ class __$MangaTrackingDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of MangaTrackingData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@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,
|
||||
}) {
|
||||
@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,}) {
|
||||
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
|
||||
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
|
||||
|
||||
@@ -9,8 +9,9 @@ part of 'manga.dart';
|
||||
_MangaTrackingData _$MangaTrackingDataFromJson(Map<String, dynamic> json) =>
|
||||
_MangaTrackingData(
|
||||
json['id'] as String,
|
||||
const MediumTrackingStateConverter()
|
||||
.fromJson((json['state'] as num).toInt()),
|
||||
const MediumTrackingStateConverter().fromJson(
|
||||
(json['state'] as num).toInt(),
|
||||
),
|
||||
json['title'] as String,
|
||||
(json['chaptersRead'] as num).toInt(),
|
||||
(json['volumesOwned'] as num).toInt(),
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:anitrack/src/data/anime.dart';
|
||||
import 'package:anitrack/src/data/manga.dart';
|
||||
import 'package:anitrack/src/service/migrations/0000_airing.dart';
|
||||
import 'package:anitrack/src/service/migrations/0000_score.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
||||
|
||||
const animeTable = 'Anime';
|
||||
@@ -32,6 +31,7 @@ Future<void> _createDatabase(Database db, int version) async {
|
||||
episodesWatched INTEGER NOT NULL,
|
||||
thumbnailUrl TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
otherTitles TEXT NOT NULL,
|
||||
score INTEGER,
|
||||
airing INTEGER NOT NULL,
|
||||
broadcastDay TEXT
|
||||
@@ -47,6 +47,7 @@ Future<void> _createDatabase(Database db, int version) async {
|
||||
volumesOwned INTEGER NOT NULL,
|
||||
thumbnailUrl TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
otherTitles TEXT NOT NULL,
|
||||
score INTEGER
|
||||
)''',
|
||||
);
|
||||
|
||||
@@ -11,72 +11,47 @@ part of 'anime_list_bloc.dart';
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AnimeListState {
|
||||
bool get buttonVisibility;
|
||||
List<AnimeTrackingData> get animes;
|
||||
List<MangaTrackingData> get mangas;
|
||||
MediumTrackingState get animeFilterState;
|
||||
MediumTrackingState get mangaFilterState;
|
||||
TrackingMediumType get trackingType;
|
||||
|
||||
bool get buttonVisibility; List<AnimeTrackingData> get animes; List<MangaTrackingData> get mangas; MediumTrackingState get animeFilterState; MediumTrackingState get mangaFilterState; TrackingMediumType get trackingType;
|
||||
/// Create a copy of AnimeListState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$AnimeListStateCopyWith<AnimeListState> get copyWith =>
|
||||
_$AnimeListStateCopyWithImpl<AnimeListState>(
|
||||
this as AnimeListState, _$identity);
|
||||
$AnimeListStateCopyWith<AnimeListState> get copyWith => _$AnimeListStateCopyWithImpl<AnimeListState>(this as AnimeListState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is AnimeListState &&
|
||||
(identical(other.buttonVisibility, buttonVisibility) ||
|
||||
other.buttonVisibility == buttonVisibility) &&
|
||||
const DeepCollectionEquality().equals(other.animes, animes) &&
|
||||
const DeepCollectionEquality().equals(other.mangas, mangas) &&
|
||||
(identical(other.animeFilterState, animeFilterState) ||
|
||||
other.animeFilterState == animeFilterState) &&
|
||||
(identical(other.mangaFilterState, mangaFilterState) ||
|
||||
other.mangaFilterState == mangaFilterState) &&
|
||||
(identical(other.trackingType, trackingType) ||
|
||||
other.trackingType == trackingType));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,buttonVisibility,const DeepCollectionEquality().hash(animes),const DeepCollectionEquality().hash(mangas),animeFilterState,mangaFilterState,trackingType);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $AnimeListStateCopyWith<$Res> {
|
||||
factory $AnimeListStateCopyWith(
|
||||
AnimeListState value, $Res Function(AnimeListState) _then) =
|
||||
_$AnimeListStateCopyWithImpl;
|
||||
factory $AnimeListStateCopyWith(AnimeListState value, $Res Function(AnimeListState) _then) = _$AnimeListStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool buttonVisibility,
|
||||
List<AnimeTrackingData> animes,
|
||||
List<MangaTrackingData> mangas,
|
||||
MediumTrackingState animeFilterState,
|
||||
MediumTrackingState mangaFilterState,
|
||||
TrackingMediumType trackingType});
|
||||
}
|
||||
$Res call({
|
||||
bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$AnimeListStateCopyWithImpl<$Res>
|
||||
implements $AnimeListStateCopyWith<$Res> {
|
||||
@@ -87,45 +62,21 @@ class _$AnimeListStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of AnimeListState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? buttonVisibility = null,
|
||||
Object? animes = null,
|
||||
Object? mangas = null,
|
||||
Object? animeFilterState = null,
|
||||
Object? mangaFilterState = null,
|
||||
Object? trackingType = null,
|
||||
}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? buttonVisibility = null,Object? animes = null,Object? mangas = null,Object? animeFilterState = null,Object? mangaFilterState = null,Object? trackingType = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
buttonVisibility: null == buttonVisibility
|
||||
? _self.buttonVisibility
|
||||
: buttonVisibility // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
animes: null == animes
|
||||
? _self.animes
|
||||
: animes // ignore: cast_nullable_to_non_nullable
|
||||
as List<AnimeTrackingData>,
|
||||
mangas: null == mangas
|
||||
? _self.mangas
|
||||
: mangas // ignore: cast_nullable_to_non_nullable
|
||||
as List<MangaTrackingData>,
|
||||
animeFilterState: null == animeFilterState
|
||||
? _self.animeFilterState
|
||||
: animeFilterState // ignore: cast_nullable_to_non_nullable
|
||||
as MediumTrackingState,
|
||||
mangaFilterState: null == mangaFilterState
|
||||
? _self.mangaFilterState
|
||||
: mangaFilterState // ignore: cast_nullable_to_non_nullable
|
||||
as MediumTrackingState,
|
||||
trackingType: null == trackingType
|
||||
? _self.trackingType
|
||||
: trackingType // ignore: cast_nullable_to_non_nullable
|
||||
buttonVisibility: null == buttonVisibility ? _self.buttonVisibility : buttonVisibility // ignore: cast_nullable_to_non_nullable
|
||||
as bool,animes: null == animes ? _self.animes : animes // ignore: cast_nullable_to_non_nullable
|
||||
as List<AnimeTrackingData>,mangas: null == mangas ? _self.mangas : mangas // ignore: cast_nullable_to_non_nullable
|
||||
as List<MangaTrackingData>,animeFilterState: null == animeFilterState ? _self.animeFilterState : animeFilterState // ignore: cast_nullable_to_non_nullable
|
||||
as MediumTrackingState,mangaFilterState: null == mangaFilterState ? _self.mangaFilterState : mangaFilterState // ignore: cast_nullable_to_non_nullable
|
||||
as MediumTrackingState,trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMediumType,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [AnimeListState].
|
||||
extension AnimeListStatePatterns on AnimeListState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
@@ -140,20 +91,15 @@ extension AnimeListStatePatterns on AnimeListState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AnimeListState value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AnimeListState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeListState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
@@ -167,19 +113,15 @@ extension AnimeListStatePatterns on AnimeListState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AnimeListState value) $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AnimeListState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeListState():
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -192,19 +134,15 @@ extension AnimeListStatePatterns on AnimeListState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AnimeListState value)? $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AnimeListState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeListState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -217,28 +155,14 @@ extension AnimeListStatePatterns on AnimeListState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeListState() when $default != null:
|
||||
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
|
||||
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
|
||||
case _:
|
||||
return $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.
|
||||
@@ -252,27 +176,14 @@ extension AnimeListStatePatterns on AnimeListState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeListState():
|
||||
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
|
||||
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
|
||||
case _:
|
||||
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:
|
||||
@@ -285,130 +196,80 @@ extension AnimeListStatePatterns on AnimeListState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@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;
|
||||
@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 $default(_that.buttonVisibility,_that.animes,_that.mangas,_that.animeFilterState,_that.mangaFilterState,_that.trackingType);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _AnimeListState implements AnimeListState {
|
||||
_AnimeListState(
|
||||
{this.buttonVisibility = true,
|
||||
final List<AnimeTrackingData> animes = const [],
|
||||
final List<MangaTrackingData> mangas = const [],
|
||||
this.animeFilterState = MediumTrackingState.ongoing,
|
||||
this.mangaFilterState = MediumTrackingState.ongoing,
|
||||
this.trackingType = TrackingMediumType.anime})
|
||||
: _animes = animes,
|
||||
_mangas = mangas;
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool buttonVisibility;
|
||||
class _AnimeListState implements AnimeListState {
|
||||
_AnimeListState({this.buttonVisibility = true, final List<AnimeTrackingData> animes = const [], final List<MangaTrackingData> mangas = const [], this.animeFilterState = MediumTrackingState.ongoing, this.mangaFilterState = MediumTrackingState.ongoing, this.trackingType = TrackingMediumType.anime}): _animes = animes,_mangas = mangas;
|
||||
|
||||
|
||||
@override@JsonKey() final bool buttonVisibility;
|
||||
final List<AnimeTrackingData> _animes;
|
||||
@override
|
||||
@JsonKey()
|
||||
List<AnimeTrackingData> get animes {
|
||||
@override@JsonKey() List<AnimeTrackingData> get animes {
|
||||
if (_animes is EqualUnmodifiableListView) return _animes;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_animes);
|
||||
}
|
||||
|
||||
final List<MangaTrackingData> _mangas;
|
||||
@override
|
||||
@JsonKey()
|
||||
List<MangaTrackingData> get mangas {
|
||||
@override@JsonKey() List<MangaTrackingData> get mangas {
|
||||
if (_mangas is EqualUnmodifiableListView) return _mangas;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_mangas);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final MediumTrackingState animeFilterState;
|
||||
@override
|
||||
@JsonKey()
|
||||
final MediumTrackingState mangaFilterState;
|
||||
@override
|
||||
@JsonKey()
|
||||
final TrackingMediumType trackingType;
|
||||
@override@JsonKey() final MediumTrackingState animeFilterState;
|
||||
@override@JsonKey() final MediumTrackingState mangaFilterState;
|
||||
@override@JsonKey() final TrackingMediumType trackingType;
|
||||
|
||||
/// Create a copy of AnimeListState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$AnimeListStateCopyWith<_AnimeListState> get copyWith =>
|
||||
__$AnimeListStateCopyWithImpl<_AnimeListState>(this, _$identity);
|
||||
_$AnimeListStateCopyWith<_AnimeListState> get copyWith => __$AnimeListStateCopyWithImpl<_AnimeListState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _AnimeListState &&
|
||||
(identical(other.buttonVisibility, buttonVisibility) ||
|
||||
other.buttonVisibility == buttonVisibility) &&
|
||||
const DeepCollectionEquality().equals(other._animes, _animes) &&
|
||||
const DeepCollectionEquality().equals(other._mangas, _mangas) &&
|
||||
(identical(other.animeFilterState, animeFilterState) ||
|
||||
other.animeFilterState == animeFilterState) &&
|
||||
(identical(other.mangaFilterState, mangaFilterState) ||
|
||||
other.mangaFilterState == mangaFilterState) &&
|
||||
(identical(other.trackingType, trackingType) ||
|
||||
other.trackingType == trackingType));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,buttonVisibility,const DeepCollectionEquality().hash(_animes),const DeepCollectionEquality().hash(_mangas),animeFilterState,mangaFilterState,trackingType);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$AnimeListStateCopyWith<$Res>
|
||||
implements $AnimeListStateCopyWith<$Res> {
|
||||
factory _$AnimeListStateCopyWith(
|
||||
_AnimeListState value, $Res Function(_AnimeListState) _then) =
|
||||
__$AnimeListStateCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool buttonVisibility,
|
||||
List<AnimeTrackingData> animes,
|
||||
List<MangaTrackingData> mangas,
|
||||
MediumTrackingState animeFilterState,
|
||||
MediumTrackingState mangaFilterState,
|
||||
TrackingMediumType trackingType});
|
||||
}
|
||||
abstract mixin class _$AnimeListStateCopyWith<$Res> implements $AnimeListStateCopyWith<$Res> {
|
||||
factory _$AnimeListStateCopyWith(_AnimeListState value, $Res Function(_AnimeListState) _then) = __$AnimeListStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool buttonVisibility, List<AnimeTrackingData> animes, List<MangaTrackingData> mangas, MediumTrackingState animeFilterState, MediumTrackingState mangaFilterState, TrackingMediumType trackingType
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$AnimeListStateCopyWithImpl<$Res>
|
||||
implements _$AnimeListStateCopyWith<$Res> {
|
||||
@@ -419,43 +280,19 @@ class __$AnimeListStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of AnimeListState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? buttonVisibility = null,
|
||||
Object? animes = null,
|
||||
Object? mangas = null,
|
||||
Object? animeFilterState = null,
|
||||
Object? mangaFilterState = null,
|
||||
Object? trackingType = null,
|
||||
}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? buttonVisibility = null,Object? animes = null,Object? mangas = null,Object? animeFilterState = null,Object? mangaFilterState = null,Object? trackingType = null,}) {
|
||||
return _then(_AnimeListState(
|
||||
buttonVisibility: null == buttonVisibility
|
||||
? _self.buttonVisibility
|
||||
: buttonVisibility // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
animes: null == animes
|
||||
? _self._animes
|
||||
: animes // ignore: cast_nullable_to_non_nullable
|
||||
as List<AnimeTrackingData>,
|
||||
mangas: null == mangas
|
||||
? _self._mangas
|
||||
: mangas // ignore: cast_nullable_to_non_nullable
|
||||
as List<MangaTrackingData>,
|
||||
animeFilterState: null == animeFilterState
|
||||
? _self.animeFilterState
|
||||
: animeFilterState // ignore: cast_nullable_to_non_nullable
|
||||
as MediumTrackingState,
|
||||
mangaFilterState: null == mangaFilterState
|
||||
? _self.mangaFilterState
|
||||
: mangaFilterState // ignore: cast_nullable_to_non_nullable
|
||||
as MediumTrackingState,
|
||||
trackingType: null == trackingType
|
||||
? _self.trackingType
|
||||
: trackingType // ignore: cast_nullable_to_non_nullable
|
||||
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
|
||||
|
||||
@@ -11,59 +11,47 @@ part of 'anime_search_bloc.dart';
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AnimeSearchState {
|
||||
TrackingMediumType get trackingType;
|
||||
String get searchQuery;
|
||||
bool get working;
|
||||
List<SearchResult> get searchResults;
|
||||
|
||||
TrackingMediumType get trackingType; String get searchQuery; bool get working; List<SearchResult> get searchResults;
|
||||
/// Create a copy of AnimeSearchState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$AnimeSearchStateCopyWith<AnimeSearchState> get copyWith =>
|
||||
_$AnimeSearchStateCopyWithImpl<AnimeSearchState>(
|
||||
this as AnimeSearchState, _$identity);
|
||||
$AnimeSearchStateCopyWith<AnimeSearchState> get copyWith => _$AnimeSearchStateCopyWithImpl<AnimeSearchState>(this as AnimeSearchState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is AnimeSearchState &&
|
||||
(identical(other.trackingType, trackingType) ||
|
||||
other.trackingType == trackingType) &&
|
||||
(identical(other.searchQuery, searchQuery) ||
|
||||
other.searchQuery == searchQuery) &&
|
||||
(identical(other.working, working) || other.working == working) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other.searchResults, searchResults));
|
||||
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));
|
||||
int get hashCode => Object.hash(runtimeType,trackingType,searchQuery,working,const DeepCollectionEquality().hash(searchResults));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $AnimeSearchStateCopyWith<$Res> {
|
||||
factory $AnimeSearchStateCopyWith(
|
||||
AnimeSearchState value, $Res Function(AnimeSearchState) _then) =
|
||||
_$AnimeSearchStateCopyWithImpl;
|
||||
factory $AnimeSearchStateCopyWith(AnimeSearchState value, $Res Function(AnimeSearchState) _then) = _$AnimeSearchStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{TrackingMediumType trackingType,
|
||||
String searchQuery,
|
||||
bool working,
|
||||
List<SearchResult> searchResults});
|
||||
}
|
||||
$Res call({
|
||||
TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$AnimeSearchStateCopyWithImpl<$Res>
|
||||
implements $AnimeSearchStateCopyWith<$Res> {
|
||||
@@ -74,35 +62,19 @@ class _$AnimeSearchStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of AnimeSearchState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? trackingType = null,
|
||||
Object? searchQuery = null,
|
||||
Object? working = null,
|
||||
Object? searchResults = null,
|
||||
}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? trackingType = null,Object? searchQuery = null,Object? working = null,Object? searchResults = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
trackingType: null == trackingType
|
||||
? _self.trackingType
|
||||
: trackingType // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMediumType,
|
||||
searchQuery: null == searchQuery
|
||||
? _self.searchQuery
|
||||
: searchQuery // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
working: null == working
|
||||
? _self.working
|
||||
: working // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
searchResults: null == searchResults
|
||||
? _self.searchResults
|
||||
: searchResults // ignore: cast_nullable_to_non_nullable
|
||||
trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMediumType,searchQuery: null == searchQuery ? _self.searchQuery : searchQuery // ignore: cast_nullable_to_non_nullable
|
||||
as String,working: null == working ? _self.working : working // ignore: cast_nullable_to_non_nullable
|
||||
as bool,searchResults: null == searchResults ? _self.searchResults : searchResults // ignore: cast_nullable_to_non_nullable
|
||||
as List<SearchResult>,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [AnimeSearchState].
|
||||
extension AnimeSearchStatePatterns on AnimeSearchState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
@@ -117,20 +89,15 @@ extension AnimeSearchStatePatterns on AnimeSearchState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AnimeSearchState value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AnimeSearchState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeSearchState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
@@ -144,19 +111,15 @@ extension AnimeSearchStatePatterns on AnimeSearchState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AnimeSearchState value) $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AnimeSearchState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeSearchState():
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -169,19 +132,15 @@ extension AnimeSearchStatePatterns on AnimeSearchState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AnimeSearchState value)? $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AnimeSearchState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeSearchState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -194,23 +153,14 @@ extension AnimeSearchStatePatterns on AnimeSearchState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function(TrackingMediumType trackingType, String searchQuery,
|
||||
bool working, List<SearchResult> searchResults)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeSearchState() when $default != null:
|
||||
return $default(_that.trackingType, _that.searchQuery, _that.working,
|
||||
_that.searchResults);
|
||||
case _:
|
||||
return $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.
|
||||
@@ -224,22 +174,14 @@ extension AnimeSearchStatePatterns on AnimeSearchState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function(TrackingMediumType trackingType, String searchQuery,
|
||||
bool working, List<SearchResult> searchResults)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _AnimeSearchState():
|
||||
return $default(_that.trackingType, _that.searchQuery, _that.working,
|
||||
_that.searchResults);
|
||||
case _:
|
||||
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:
|
||||
@@ -252,98 +194,72 @@ extension AnimeSearchStatePatterns on AnimeSearchState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function(TrackingMediumType trackingType, String searchQuery,
|
||||
bool working, List<SearchResult> searchResults)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@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 $default(_that.trackingType,_that.searchQuery,_that.working,_that.searchResults);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _AnimeSearchState implements AnimeSearchState {
|
||||
_AnimeSearchState(
|
||||
{this.trackingType = TrackingMediumType.anime,
|
||||
this.searchQuery = '',
|
||||
this.working = false,
|
||||
final List<SearchResult> searchResults = const []})
|
||||
: _searchResults = searchResults;
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final TrackingMediumType trackingType;
|
||||
@override
|
||||
@JsonKey()
|
||||
final String searchQuery;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool working;
|
||||
class _AnimeSearchState implements AnimeSearchState {
|
||||
_AnimeSearchState({this.trackingType = TrackingMediumType.anime, this.searchQuery = '', this.working = false, final List<SearchResult> searchResults = const []}): _searchResults = searchResults;
|
||||
|
||||
|
||||
@override@JsonKey() final TrackingMediumType trackingType;
|
||||
@override@JsonKey() final String searchQuery;
|
||||
@override@JsonKey() final bool working;
|
||||
final List<SearchResult> _searchResults;
|
||||
@override
|
||||
@JsonKey()
|
||||
List<SearchResult> get searchResults {
|
||||
@override@JsonKey() List<SearchResult> get searchResults {
|
||||
if (_searchResults is EqualUnmodifiableListView) return _searchResults;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_searchResults);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of AnimeSearchState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$AnimeSearchStateCopyWith<_AnimeSearchState> get copyWith =>
|
||||
__$AnimeSearchStateCopyWithImpl<_AnimeSearchState>(this, _$identity);
|
||||
_$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));
|
||||
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));
|
||||
int get hashCode => Object.hash(runtimeType,trackingType,searchQuery,working,const DeepCollectionEquality().hash(_searchResults));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$AnimeSearchStateCopyWith<$Res>
|
||||
implements $AnimeSearchStateCopyWith<$Res> {
|
||||
factory _$AnimeSearchStateCopyWith(
|
||||
_AnimeSearchState value, $Res Function(_AnimeSearchState) _then) =
|
||||
__$AnimeSearchStateCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{TrackingMediumType trackingType,
|
||||
String searchQuery,
|
||||
bool working,
|
||||
List<SearchResult> searchResults});
|
||||
}
|
||||
abstract mixin class _$AnimeSearchStateCopyWith<$Res> implements $AnimeSearchStateCopyWith<$Res> {
|
||||
factory _$AnimeSearchStateCopyWith(_AnimeSearchState value, $Res Function(_AnimeSearchState) _then) = __$AnimeSearchStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
TrackingMediumType trackingType, String searchQuery, bool working, List<SearchResult> searchResults
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$AnimeSearchStateCopyWithImpl<$Res>
|
||||
implements _$AnimeSearchStateCopyWith<$Res> {
|
||||
@@ -354,33 +270,17 @@ class __$AnimeSearchStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of AnimeSearchState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? trackingType = null,
|
||||
Object? searchQuery = null,
|
||||
Object? working = null,
|
||||
Object? searchResults = null,
|
||||
}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? trackingType = null,Object? searchQuery = null,Object? working = null,Object? searchResults = null,}) {
|
||||
return _then(_AnimeSearchState(
|
||||
trackingType: null == trackingType
|
||||
? _self.trackingType
|
||||
: trackingType // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMediumType,
|
||||
searchQuery: null == searchQuery
|
||||
? _self.searchQuery
|
||||
: searchQuery // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
working: null == working
|
||||
? _self.working
|
||||
: working // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
searchResults: null == searchResults
|
||||
? _self._searchResults
|
||||
: searchResults // ignore: cast_nullable_to_non_nullable
|
||||
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
|
||||
|
||||
@@ -11,53 +11,47 @@ part of 'calendar_bloc.dart';
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CalendarState {
|
||||
bool get refreshing;
|
||||
int get refreshingCount;
|
||||
int get refreshingTotal;
|
||||
|
||||
bool get refreshing; int get refreshingCount; int get refreshingTotal;
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$CalendarStateCopyWith<CalendarState> get copyWith =>
|
||||
_$CalendarStateCopyWithImpl<CalendarState>(
|
||||
this as CalendarState, _$identity);
|
||||
$CalendarStateCopyWith<CalendarState> get copyWith => _$CalendarStateCopyWithImpl<CalendarState>(this as CalendarState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is CalendarState &&
|
||||
(identical(other.refreshing, refreshing) ||
|
||||
other.refreshing == refreshing) &&
|
||||
(identical(other.refreshingCount, refreshingCount) ||
|
||||
other.refreshingCount == refreshingCount) &&
|
||||
(identical(other.refreshingTotal, refreshingTotal) ||
|
||||
other.refreshingTotal == refreshingTotal));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,refreshing,refreshingCount,refreshingTotal);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $CalendarStateCopyWith<$Res> {
|
||||
factory $CalendarStateCopyWith(
|
||||
CalendarState value, $Res Function(CalendarState) _then) =
|
||||
_$CalendarStateCopyWithImpl;
|
||||
factory $CalendarStateCopyWith(CalendarState value, $Res Function(CalendarState) _then) = _$CalendarStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({bool refreshing, int refreshingCount, int refreshingTotal});
|
||||
}
|
||||
$Res call({
|
||||
bool refreshing, int refreshingCount, int refreshingTotal
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$CalendarStateCopyWithImpl<$Res>
|
||||
implements $CalendarStateCopyWith<$Res> {
|
||||
@@ -68,30 +62,18 @@ class _$CalendarStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? refreshing = null,
|
||||
Object? refreshingCount = null,
|
||||
Object? refreshingTotal = null,
|
||||
}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? refreshing = null,Object? refreshingCount = null,Object? refreshingTotal = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
refreshing: null == refreshing
|
||||
? _self.refreshing
|
||||
: refreshing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
refreshingCount: null == refreshingCount
|
||||
? _self.refreshingCount
|
||||
: refreshingCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
refreshingTotal: null == refreshingTotal
|
||||
? _self.refreshingTotal
|
||||
: refreshingTotal // ignore: cast_nullable_to_non_nullable
|
||||
refreshing: null == refreshing ? _self.refreshing : refreshing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,refreshingCount: null == refreshingCount ? _self.refreshingCount : refreshingCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,refreshingTotal: null == refreshingTotal ? _self.refreshingTotal : refreshingTotal // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [CalendarState].
|
||||
extension CalendarStatePatterns on CalendarState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
@@ -106,20 +88,15 @@ extension CalendarStatePatterns on CalendarState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _CalendarState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CalendarState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
@@ -133,19 +110,15 @@ extension CalendarStatePatterns on CalendarState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value) $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _CalendarState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CalendarState():
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -158,19 +131,15 @@ extension CalendarStatePatterns on CalendarState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_CalendarState value)? $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _CalendarState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CalendarState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -183,22 +152,14 @@ extension CalendarStatePatterns on CalendarState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function(bool refreshing, int refreshingCount, int refreshingTotal)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool refreshing, int refreshingCount, int refreshingTotal)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CalendarState() when $default != null:
|
||||
return $default(
|
||||
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
|
||||
case _:
|
||||
return $default(_that.refreshing,_that.refreshingCount,_that.refreshingTotal);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
@@ -212,21 +173,14 @@ extension CalendarStatePatterns on CalendarState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function(bool refreshing, int refreshingCount, int refreshingTotal)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool refreshing, int refreshingCount, int refreshingTotal) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CalendarState():
|
||||
return $default(
|
||||
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
|
||||
case _:
|
||||
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:
|
||||
@@ -239,77 +193,65 @@ extension CalendarStatePatterns on CalendarState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function(
|
||||
bool refreshing, int refreshingCount, int refreshingTotal)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@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 $default(_that.refreshing,_that.refreshingCount,_that.refreshingTotal);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _CalendarState implements CalendarState {
|
||||
_CalendarState(this.refreshing, this.refreshingCount, this.refreshingTotal);
|
||||
|
||||
@override
|
||||
final bool refreshing;
|
||||
@override
|
||||
final int refreshingCount;
|
||||
@override
|
||||
final int refreshingTotal;
|
||||
|
||||
@override final bool refreshing;
|
||||
@override final int refreshingCount;
|
||||
@override final int refreshingTotal;
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$CalendarStateCopyWith<_CalendarState> get copyWith =>
|
||||
__$CalendarStateCopyWithImpl<_CalendarState>(this, _$identity);
|
||||
_$CalendarStateCopyWith<_CalendarState> get copyWith => __$CalendarStateCopyWithImpl<_CalendarState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _CalendarState &&
|
||||
(identical(other.refreshing, refreshing) ||
|
||||
other.refreshing == refreshing) &&
|
||||
(identical(other.refreshingCount, refreshingCount) ||
|
||||
other.refreshingCount == refreshingCount) &&
|
||||
(identical(other.refreshingTotal, refreshingTotal) ||
|
||||
other.refreshingTotal == refreshingTotal));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,refreshing,refreshingCount,refreshingTotal);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$CalendarStateCopyWith<$Res>
|
||||
implements $CalendarStateCopyWith<$Res> {
|
||||
factory _$CalendarStateCopyWith(
|
||||
_CalendarState value, $Res Function(_CalendarState) _then) =
|
||||
__$CalendarStateCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({bool refreshing, int refreshingCount, int refreshingTotal});
|
||||
}
|
||||
abstract mixin class _$CalendarStateCopyWith<$Res> implements $CalendarStateCopyWith<$Res> {
|
||||
factory _$CalendarStateCopyWith(_CalendarState value, $Res Function(_CalendarState) _then) = __$CalendarStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool refreshing, int refreshingCount, int refreshingTotal
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$CalendarStateCopyWithImpl<$Res>
|
||||
implements _$CalendarStateCopyWith<$Res> {
|
||||
@@ -320,28 +262,16 @@ class __$CalendarStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? refreshing = null,
|
||||
Object? refreshingCount = null,
|
||||
Object? refreshingTotal = null,
|
||||
}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? refreshing = null,Object? refreshingCount = null,Object? refreshingTotal = null,}) {
|
||||
return _then(_CalendarState(
|
||||
null == refreshing
|
||||
? _self.refreshing
|
||||
: refreshing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
null == refreshingCount
|
||||
? _self.refreshingCount
|
||||
: refreshingCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
null == refreshingTotal
|
||||
? _self.refreshingTotal
|
||||
: refreshingTotal // ignore: cast_nullable_to_non_nullable
|
||||
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
|
||||
|
||||
@@ -11,57 +11,50 @@ part of 'details_bloc.dart';
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DetailsState {
|
||||
TrackingMedium? get data;
|
||||
String? get heroImagePrefix;
|
||||
TrackingMediumType get trackingType;
|
||||
|
||||
TrackingMedium? get data; String? get heroImagePrefix; TrackingMediumType get trackingType;
|
||||
/// Create a copy of DetailsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$DetailsStateCopyWith<DetailsState> get copyWith =>
|
||||
_$DetailsStateCopyWithImpl<DetailsState>(
|
||||
this as DetailsState, _$identity);
|
||||
$DetailsStateCopyWith<DetailsState> get copyWith => _$DetailsStateCopyWithImpl<DetailsState>(this as DetailsState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is DetailsState &&
|
||||
(identical(other.data, data) || other.data == data) &&
|
||||
(identical(other.heroImagePrefix, heroImagePrefix) ||
|
||||
other.heroImagePrefix == heroImagePrefix) &&
|
||||
(identical(other.trackingType, trackingType) ||
|
||||
other.trackingType == trackingType));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,data,heroImagePrefix,trackingType);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $DetailsStateCopyWith<$Res> {
|
||||
factory $DetailsStateCopyWith(
|
||||
DetailsState value, $Res Function(DetailsState) _then) =
|
||||
_$DetailsStateCopyWithImpl;
|
||||
factory $DetailsStateCopyWith(DetailsState value, $Res Function(DetailsState) _then) = _$DetailsStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{TrackingMedium? data,
|
||||
String? heroImagePrefix,
|
||||
TrackingMediumType trackingType});
|
||||
}
|
||||
$Res call({
|
||||
TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$DetailsStateCopyWithImpl<$Res> implements $DetailsStateCopyWith<$Res> {
|
||||
class _$DetailsStateCopyWithImpl<$Res>
|
||||
implements $DetailsStateCopyWith<$Res> {
|
||||
_$DetailsStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final DetailsState _self;
|
||||
@@ -69,30 +62,18 @@ class _$DetailsStateCopyWithImpl<$Res> implements $DetailsStateCopyWith<$Res> {
|
||||
|
||||
/// Create a copy of DetailsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = freezed,
|
||||
Object? heroImagePrefix = freezed,
|
||||
Object? trackingType = null,
|
||||
}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? data = freezed,Object? heroImagePrefix = freezed,Object? trackingType = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
data: freezed == data
|
||||
? _self.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMedium?,
|
||||
heroImagePrefix: freezed == heroImagePrefix
|
||||
? _self.heroImagePrefix
|
||||
: heroImagePrefix // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
trackingType: null == trackingType
|
||||
? _self.trackingType
|
||||
: trackingType // ignore: cast_nullable_to_non_nullable
|
||||
data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMedium?,heroImagePrefix: freezed == heroImagePrefix ? _self.heroImagePrefix : heroImagePrefix // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trackingType: null == trackingType ? _self.trackingType : trackingType // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMediumType,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [DetailsState].
|
||||
extension DetailsStatePatterns on DetailsState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
@@ -107,20 +88,15 @@ extension DetailsStatePatterns on DetailsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DetailsState value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _DetailsState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DetailsState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
@@ -134,19 +110,15 @@ extension DetailsStatePatterns on DetailsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_DetailsState value) $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _DetailsState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DetailsState():
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -159,19 +131,15 @@ extension DetailsStatePatterns on DetailsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_DetailsState value)? $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _DetailsState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DetailsState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -184,22 +152,14 @@ extension DetailsStatePatterns on DetailsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function(TrackingMedium? data, String? heroImagePrefix,
|
||||
TrackingMediumType trackingType)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DetailsState() when $default != null:
|
||||
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
|
||||
case _:
|
||||
return $default(_that.data,_that.heroImagePrefix,_that.trackingType);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
@@ -213,21 +173,14 @@ extension DetailsStatePatterns on DetailsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function(TrackingMedium? data, String? heroImagePrefix,
|
||||
TrackingMediumType trackingType)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DetailsState():
|
||||
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
|
||||
case _:
|
||||
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:
|
||||
@@ -240,82 +193,65 @@ extension DetailsStatePatterns on DetailsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function(TrackingMedium? data, String? heroImagePrefix,
|
||||
TrackingMediumType trackingType)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@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 $default(_that.data,_that.heroImagePrefix,_that.trackingType);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _DetailsState implements DetailsState {
|
||||
_DetailsState(
|
||||
{this.data,
|
||||
this.heroImagePrefix,
|
||||
this.trackingType = TrackingMediumType.anime});
|
||||
|
||||
@override
|
||||
final TrackingMedium? data;
|
||||
@override
|
||||
final String? heroImagePrefix;
|
||||
@override
|
||||
@JsonKey()
|
||||
final TrackingMediumType trackingType;
|
||||
class _DetailsState implements DetailsState {
|
||||
_DetailsState({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
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$DetailsStateCopyWith<_DetailsState> get copyWith =>
|
||||
__$DetailsStateCopyWithImpl<_DetailsState>(this, _$identity);
|
||||
_$DetailsStateCopyWith<_DetailsState> get copyWith => __$DetailsStateCopyWithImpl<_DetailsState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _DetailsState &&
|
||||
(identical(other.data, data) || other.data == data) &&
|
||||
(identical(other.heroImagePrefix, heroImagePrefix) ||
|
||||
other.heroImagePrefix == heroImagePrefix) &&
|
||||
(identical(other.trackingType, trackingType) ||
|
||||
other.trackingType == trackingType));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,data,heroImagePrefix,trackingType);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$DetailsStateCopyWith<$Res>
|
||||
implements $DetailsStateCopyWith<$Res> {
|
||||
factory _$DetailsStateCopyWith(
|
||||
_DetailsState value, $Res Function(_DetailsState) _then) =
|
||||
__$DetailsStateCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{TrackingMedium? data,
|
||||
String? heroImagePrefix,
|
||||
TrackingMediumType trackingType});
|
||||
}
|
||||
abstract mixin class _$DetailsStateCopyWith<$Res> implements $DetailsStateCopyWith<$Res> {
|
||||
factory _$DetailsStateCopyWith(_DetailsState value, $Res Function(_DetailsState) _then) = __$DetailsStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
TrackingMedium? data, String? heroImagePrefix, TrackingMediumType trackingType
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$DetailsStateCopyWithImpl<$Res>
|
||||
implements _$DetailsStateCopyWith<$Res> {
|
||||
@@ -326,28 +262,16 @@ class __$DetailsStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of DetailsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? data = freezed,
|
||||
Object? heroImagePrefix = freezed,
|
||||
Object? trackingType = null,
|
||||
}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? data = freezed,Object? heroImagePrefix = freezed,Object? trackingType = null,}) {
|
||||
return _then(_DetailsState(
|
||||
data: freezed == data
|
||||
? _self.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TrackingMedium?,
|
||||
heroImagePrefix: freezed == heroImagePrefix
|
||||
? _self.heroImagePrefix
|
||||
: heroImagePrefix // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
trackingType: null == trackingType
|
||||
? _self.trackingType
|
||||
: trackingType // ignore: cast_nullable_to_non_nullable
|
||||
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
|
||||
|
||||
@@ -11,53 +11,47 @@ part of 'settings_bloc.dart';
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SettingsState {
|
||||
bool get importSpinnerVisible;
|
||||
int get importCurrent;
|
||||
int get importTotal;
|
||||
|
||||
bool get importSpinnerVisible; int get importCurrent; int get importTotal;
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$SettingsStateCopyWith<SettingsState> get copyWith =>
|
||||
_$SettingsStateCopyWithImpl<SettingsState>(
|
||||
this as SettingsState, _$identity);
|
||||
$SettingsStateCopyWith<SettingsState> get copyWith => _$SettingsStateCopyWithImpl<SettingsState>(this as SettingsState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is SettingsState &&
|
||||
(identical(other.importSpinnerVisible, importSpinnerVisible) ||
|
||||
other.importSpinnerVisible == importSpinnerVisible) &&
|
||||
(identical(other.importCurrent, importCurrent) ||
|
||||
other.importCurrent == importCurrent) &&
|
||||
(identical(other.importTotal, importTotal) ||
|
||||
other.importTotal == importTotal));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,importSpinnerVisible,importCurrent,importTotal);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $SettingsStateCopyWith<$Res> {
|
||||
factory $SettingsStateCopyWith(
|
||||
SettingsState value, $Res Function(SettingsState) _then) =
|
||||
_$SettingsStateCopyWithImpl;
|
||||
factory $SettingsStateCopyWith(SettingsState value, $Res Function(SettingsState) _then) = _$SettingsStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({bool importSpinnerVisible, int importCurrent, int importTotal});
|
||||
}
|
||||
$Res call({
|
||||
bool importSpinnerVisible, int importCurrent, int importTotal
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$SettingsStateCopyWithImpl<$Res>
|
||||
implements $SettingsStateCopyWith<$Res> {
|
||||
@@ -68,30 +62,18 @@ class _$SettingsStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? importSpinnerVisible = null,
|
||||
Object? importCurrent = null,
|
||||
Object? importTotal = null,
|
||||
}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? importSpinnerVisible = null,Object? importCurrent = null,Object? importTotal = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
importSpinnerVisible: null == importSpinnerVisible
|
||||
? _self.importSpinnerVisible
|
||||
: importSpinnerVisible // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
importCurrent: null == importCurrent
|
||||
? _self.importCurrent
|
||||
: importCurrent // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
importTotal: null == importTotal
|
||||
? _self.importTotal
|
||||
: importTotal // ignore: cast_nullable_to_non_nullable
|
||||
importSpinnerVisible: null == importSpinnerVisible ? _self.importSpinnerVisible : importSpinnerVisible // ignore: cast_nullable_to_non_nullable
|
||||
as bool,importCurrent: null == importCurrent ? _self.importCurrent : importCurrent // ignore: cast_nullable_to_non_nullable
|
||||
as int,importTotal: null == importTotal ? _self.importTotal : importTotal // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [SettingsState].
|
||||
extension SettingsStatePatterns on SettingsState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
@@ -106,20 +88,15 @@ extension SettingsStatePatterns on SettingsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _SettingsState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SettingsState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
@@ -133,19 +110,15 @@ extension SettingsStatePatterns on SettingsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value) $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _SettingsState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SettingsState():
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -158,19 +131,15 @@ extension SettingsStatePatterns on SettingsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SettingsState value)? $default,
|
||||
) {
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _SettingsState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SettingsState() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
@@ -183,23 +152,14 @@ extension SettingsStatePatterns on SettingsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function(
|
||||
bool importSpinnerVisible, int importCurrent, int importTotal)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool importSpinnerVisible, int importCurrent, int importTotal)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SettingsState() when $default != null:
|
||||
return $default(
|
||||
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
|
||||
case _:
|
||||
return $default(_that.importSpinnerVisible,_that.importCurrent,_that.importTotal);case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
@@ -213,22 +173,14 @@ extension SettingsStatePatterns on SettingsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function(
|
||||
bool importSpinnerVisible, int importCurrent, int importTotal)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool importSpinnerVisible, int importCurrent, int importTotal) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SettingsState():
|
||||
return $default(
|
||||
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
|
||||
case _:
|
||||
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:
|
||||
@@ -241,83 +193,65 @@ extension SettingsStatePatterns on SettingsState {
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function(
|
||||
bool importSpinnerVisible, int importCurrent, int importTotal)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
@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 $default(_that.importSpinnerVisible,_that.importCurrent,_that.importTotal);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _SettingsState implements SettingsState {
|
||||
_SettingsState(
|
||||
{this.importSpinnerVisible = false,
|
||||
this.importCurrent = 0,
|
||||
this.importTotal = 0});
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool importSpinnerVisible;
|
||||
@override
|
||||
@JsonKey()
|
||||
final int importCurrent;
|
||||
@override
|
||||
@JsonKey()
|
||||
final int importTotal;
|
||||
class _SettingsState implements SettingsState {
|
||||
_SettingsState({this.importSpinnerVisible = false, this.importCurrent = 0, this.importTotal = 0});
|
||||
|
||||
|
||||
@override@JsonKey() final bool importSpinnerVisible;
|
||||
@override@JsonKey() final int importCurrent;
|
||||
@override@JsonKey() final int importTotal;
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SettingsStateCopyWith<_SettingsState> get copyWith =>
|
||||
__$SettingsStateCopyWithImpl<_SettingsState>(this, _$identity);
|
||||
_$SettingsStateCopyWith<_SettingsState> get copyWith => __$SettingsStateCopyWithImpl<_SettingsState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _SettingsState &&
|
||||
(identical(other.importSpinnerVisible, importSpinnerVisible) ||
|
||||
other.importSpinnerVisible == importSpinnerVisible) &&
|
||||
(identical(other.importCurrent, importCurrent) ||
|
||||
other.importCurrent == importCurrent) &&
|
||||
(identical(other.importTotal, importTotal) ||
|
||||
other.importTotal == importTotal));
|
||||
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);
|
||||
int get hashCode => Object.hash(runtimeType,importSpinnerVisible,importCurrent,importTotal);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SettingsStateCopyWith<$Res>
|
||||
implements $SettingsStateCopyWith<$Res> {
|
||||
factory _$SettingsStateCopyWith(
|
||||
_SettingsState value, $Res Function(_SettingsState) _then) =
|
||||
__$SettingsStateCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({bool importSpinnerVisible, int importCurrent, int importTotal});
|
||||
}
|
||||
abstract mixin class _$SettingsStateCopyWith<$Res> implements $SettingsStateCopyWith<$Res> {
|
||||
factory _$SettingsStateCopyWith(_SettingsState value, $Res Function(_SettingsState) _then) = __$SettingsStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool importSpinnerVisible, int importCurrent, int importTotal
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$SettingsStateCopyWithImpl<$Res>
|
||||
implements _$SettingsStateCopyWith<$Res> {
|
||||
@@ -328,28 +262,16 @@ class __$SettingsStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? importSpinnerVisible = null,
|
||||
Object? importCurrent = null,
|
||||
Object? importTotal = null,
|
||||
}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? importSpinnerVisible = null,Object? importCurrent = null,Object? importTotal = null,}) {
|
||||
return _then(_SettingsState(
|
||||
importSpinnerVisible: null == importSpinnerVisible
|
||||
? _self.importSpinnerVisible
|
||||
: importSpinnerVisible // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
importCurrent: null == importCurrent
|
||||
? _self.importCurrent
|
||||
: importCurrent // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
importTotal: null == importTotal
|
||||
? _self.importTotal
|
||||
: importTotal // ignore: cast_nullable_to_non_nullable
|
||||
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
|
||||
|
||||
@@ -56,12 +56,20 @@ class DetailsPage extends StatelessWidget {
|
||||
Text(
|
||||
state.data!.title,
|
||||
textAlign: TextAlign.left,
|
||||
style:
|
||||
Theme.of(context).textTheme.titleLarge,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.titleLarge,
|
||||
maxLines: 2,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 6,
|
||||
),
|
||||
child: Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final result = await showDialog<bool>(
|
||||
@@ -81,11 +89,14 @@ class DetailsPage extends StatelessWidget {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context)
|
||||
.pop(true);
|
||||
Navigator.of(
|
||||
context,
|
||||
).pop(true);
|
||||
},
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.red,
|
||||
style:
|
||||
TextButton.styleFrom(
|
||||
foregroundColor:
|
||||
Colors.red,
|
||||
),
|
||||
child: Text(
|
||||
t.details.removeButton,
|
||||
@@ -93,8 +104,9 @@ class DetailsPage extends StatelessWidget {
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context)
|
||||
.pop(false);
|
||||
Navigator.of(
|
||||
context,
|
||||
).pop(false);
|
||||
},
|
||||
child: Text(
|
||||
t.details.cancelButton,
|
||||
@@ -115,7 +127,85 @@ class DetailsPage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -136,8 +226,7 @@ class DetailsPage extends StatelessWidget {
|
||||
TrackingMediumType.anime) {
|
||||
context.read<DetailsBloc>().add(
|
||||
DetailsUpdatedEvent(
|
||||
(state.data! as AnimeTrackingData)
|
||||
.copyWith(
|
||||
(state.data! as AnimeTrackingData).copyWith(
|
||||
state: newState,
|
||||
),
|
||||
),
|
||||
@@ -146,8 +235,7 @@ class DetailsPage extends StatelessWidget {
|
||||
TrackingMediumType.manga) {
|
||||
context.read<DetailsBloc>().add(
|
||||
DetailsUpdatedEvent(
|
||||
(state.data! as MangaTrackingData)
|
||||
.copyWith(
|
||||
(state.data! as MangaTrackingData).copyWith(
|
||||
state: newState,
|
||||
),
|
||||
),
|
||||
@@ -157,28 +245,33 @@ class DetailsPage extends StatelessWidget {
|
||||
values: [
|
||||
SelectorItem(
|
||||
MediumTrackingState.ongoing,
|
||||
MediumTrackingState.ongoing
|
||||
.getName(state.trackingType),
|
||||
MediumTrackingState.ongoing.getName(
|
||||
state.trackingType,
|
||||
),
|
||||
),
|
||||
SelectorItem(
|
||||
MediumTrackingState.completed,
|
||||
MediumTrackingState.completed
|
||||
.getName(state.trackingType),
|
||||
MediumTrackingState.completed.getName(
|
||||
state.trackingType,
|
||||
),
|
||||
),
|
||||
SelectorItem(
|
||||
MediumTrackingState.planned,
|
||||
MediumTrackingState.planned
|
||||
.getName(state.trackingType),
|
||||
MediumTrackingState.planned.getName(
|
||||
state.trackingType,
|
||||
),
|
||||
),
|
||||
SelectorItem(
|
||||
MediumTrackingState.dropped,
|
||||
MediumTrackingState.dropped
|
||||
.getName(state.trackingType),
|
||||
MediumTrackingState.dropped.getName(
|
||||
state.trackingType,
|
||||
),
|
||||
),
|
||||
SelectorItem(
|
||||
MediumTrackingState.paused,
|
||||
MediumTrackingState.paused
|
||||
.getName(state.trackingType),
|
||||
MediumTrackingState.paused.getName(
|
||||
state.trackingType,
|
||||
),
|
||||
),
|
||||
],
|
||||
initialValue: state.data!.state,
|
||||
@@ -217,8 +310,8 @@ class DetailsPage extends StatelessWidget {
|
||||
break;
|
||||
}
|
||||
},
|
||||
initialValue: state.trackingType ==
|
||||
TrackingMediumType.anime
|
||||
initialValue:
|
||||
state.trackingType == TrackingMediumType.anime
|
||||
? (state.data! as AnimeTrackingData)
|
||||
.episodesWatched
|
||||
: (state.data! as MangaTrackingData).chaptersRead,
|
||||
@@ -241,10 +334,9 @@ class DetailsPage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
initialValue: (GetIt.I
|
||||
.get<DetailsBloc>()
|
||||
.state
|
||||
.data! as MangaTrackingData)
|
||||
initialValue:
|
||||
(GetIt.I.get<DetailsBloc>().state.data!
|
||||
as MangaTrackingData)
|
||||
.volumesOwned,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user