chore: Update Flutter version and dependencies

This commit is contained in:
2026-03-08 14:10:50 +01:00
parent 4c5fa10ffd
commit 6c504e0125
19 changed files with 2578 additions and 1243 deletions

View File

@@ -17,7 +17,7 @@ class BoolConverter implements JsonConverter<bool, int> {
/// Data about a tracked anime /// Data about a tracked anime
@freezed @freezed
class AnimeTrackingData with _$AnimeTrackingData, TrackingMedium { abstract class AnimeTrackingData with _$AnimeTrackingData, TrackingMedium {
factory AnimeTrackingData( factory AnimeTrackingData(
/// The ID of the anime /// The ID of the anime
String id, String id,
@@ -44,6 +44,8 @@ class AnimeTrackingData with _$AnimeTrackingData, TrackingMedium {
String? broadcastDay, String? broadcastDay,
) = _AnimeTrackingData; ) = _AnimeTrackingData;
AnimeTrackingData._();
/// JSON /// JSON
factory AnimeTrackingData.fromJson(Map<String, dynamic> json) => factory AnimeTrackingData.fromJson(Map<String, dynamic> json) =>
_$AnimeTrackingDataFromJson(json); _$AnimeTrackingDataFromJson(json);

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint // ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
@@ -9,138 +9,83 @@ part of 'anime.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
AnimeTrackingData _$AnimeTrackingDataFromJson(Map<String, dynamic> json) {
return _AnimeTrackingData.fromJson(json);
}
/// @nodoc /// @nodoc
mixin _$AnimeTrackingData { mixin _$AnimeTrackingData {
/// The ID of the anime /// The ID of the anime
String get id => throw _privateConstructorUsedError; String get id;
/// The state of the anime /// The state of the anime
@MediumTrackingStateConverter() @MediumTrackingStateConverter()
MediumTrackingState get state => throw _privateConstructorUsedError; MediumTrackingState get state;
/// The title of the anime /// The title of the anime
String get title => throw _privateConstructorUsedError; String get title;
/// Episodes in total. /// Episodes in total.
int get episodesWatched => throw _privateConstructorUsedError; int get episodesWatched;
/// Episodes watched. /// Episodes watched.
int? get episodesTotal => throw _privateConstructorUsedError; int? get episodesTotal;
/// URL to the thumbnail/cover art for the anime. /// URL to the thumbnail/cover art for the anime.
String get thumbnailUrl => throw _privateConstructorUsedError; String get thumbnailUrl;
/// Flag whether the anime is airing /// Flag whether the anime is airing
@BoolConverter() @BoolConverter()
bool get airing => throw _privateConstructorUsedError; bool get airing;
/// The day of the week the anime is airing /// The day of the week the anime is airing
String? get broadcastDay => throw _privateConstructorUsedError; String? get broadcastDay;
/// Serializes this AnimeTrackingData to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of AnimeTrackingData /// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
$AnimeTrackingDataCopyWith<AnimeTrackingData> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $AnimeTrackingDataCopyWith<$Res> {
factory $AnimeTrackingDataCopyWith(
AnimeTrackingData value, $Res Function(AnimeTrackingData) then) =
_$AnimeTrackingDataCopyWithImpl<$Res, AnimeTrackingData>;
@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, $Val extends AnimeTrackingData>
implements $AnimeTrackingDataCopyWith<$Res> {
_$AnimeTrackingDataCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
$AnimeTrackingDataCopyWith<AnimeTrackingData> get copyWith =>
_$AnimeTrackingDataCopyWithImpl<AnimeTrackingData>(
this as AnimeTrackingData, _$identity);
/// Serializes this AnimeTrackingData to a JSON map.
Map<String, dynamic> toJson();
@override @override
$Res call({ bool operator ==(Object other) {
Object? id = null, return identical(this, other) ||
Object? state = null, (other.runtimeType == runtimeType &&
Object? title = null, other is AnimeTrackingData &&
Object? episodesWatched = null, (identical(other.id, id) || other.id == id) &&
Object? episodesTotal = freezed, (identical(other.state, state) || other.state == state) &&
Object? thumbnailUrl = null, (identical(other.title, title) || other.title == title) &&
Object? airing = null, (identical(other.episodesWatched, episodesWatched) ||
Object? broadcastDay = freezed, other.episodesWatched == episodesWatched) &&
}) { (identical(other.episodesTotal, episodesTotal) ||
return _then(_value.copyWith( other.episodesTotal == episodesTotal) &&
id: null == id (identical(other.thumbnailUrl, thumbnailUrl) ||
? _value.id other.thumbnailUrl == thumbnailUrl) &&
: id // ignore: cast_nullable_to_non_nullable (identical(other.airing, airing) || other.airing == airing) &&
as String, (identical(other.broadcastDay, broadcastDay) ||
state: null == state other.broadcastDay == broadcastDay));
? _value.state }
: state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState, @JsonKey(includeFromJson: false, includeToJson: false)
title: null == title @override
? _value.title int get hashCode => Object.hash(runtimeType, id, state, title,
: title // ignore: cast_nullable_to_non_nullable episodesWatched, episodesTotal, thumbnailUrl, airing, broadcastDay);
as String,
episodesWatched: null == episodesWatched @override
? _value.episodesWatched String toString() {
: episodesWatched // ignore: cast_nullable_to_non_nullable return 'AnimeTrackingData(id: $id, state: $state, title: $title, episodesWatched: $episodesWatched, episodesTotal: $episodesTotal, thumbnailUrl: $thumbnailUrl, airing: $airing, broadcastDay: $broadcastDay)';
as int,
episodesTotal: freezed == episodesTotal
? _value.episodesTotal
: episodesTotal // ignore: cast_nullable_to_non_nullable
as int?,
thumbnailUrl: null == thumbnailUrl
? _value.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String,
airing: null == airing
? _value.airing
: airing // ignore: cast_nullable_to_non_nullable
as bool,
broadcastDay: freezed == broadcastDay
? _value.broadcastDay
: broadcastDay // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
} }
} }
/// @nodoc /// @nodoc
abstract class _$$AnimeTrackingDataImplCopyWith<$Res> abstract mixin class $AnimeTrackingDataCopyWith<$Res> {
implements $AnimeTrackingDataCopyWith<$Res> { factory $AnimeTrackingDataCopyWith(
factory _$$AnimeTrackingDataImplCopyWith(_$AnimeTrackingDataImpl value, AnimeTrackingData value, $Res Function(AnimeTrackingData) _then) =
$Res Function(_$AnimeTrackingDataImpl) then) = _$AnimeTrackingDataCopyWithImpl;
__$$AnimeTrackingDataImplCopyWithImpl<$Res>;
@override
@useResult @useResult
$Res call( $Res call(
{String id, {String id,
@@ -154,12 +99,12 @@ abstract class _$$AnimeTrackingDataImplCopyWith<$Res>
} }
/// @nodoc /// @nodoc
class __$$AnimeTrackingDataImplCopyWithImpl<$Res> class _$AnimeTrackingDataCopyWithImpl<$Res>
extends _$AnimeTrackingDataCopyWithImpl<$Res, _$AnimeTrackingDataImpl> implements $AnimeTrackingDataCopyWith<$Res> {
implements _$$AnimeTrackingDataImplCopyWith<$Res> { _$AnimeTrackingDataCopyWithImpl(this._self, this._then);
__$$AnimeTrackingDataImplCopyWithImpl(_$AnimeTrackingDataImpl _value,
$Res Function(_$AnimeTrackingDataImpl) _then) final AnimeTrackingData _self;
: super(_value, _then); final $Res Function(AnimeTrackingData) _then;
/// Create a copy of AnimeTrackingData /// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@@ -175,47 +120,255 @@ class __$$AnimeTrackingDataImplCopyWithImpl<$Res>
Object? airing = null, Object? airing = null,
Object? broadcastDay = freezed, Object? broadcastDay = freezed,
}) { }) {
return _then(_$AnimeTrackingDataImpl( return _then(_self.copyWith(
null == id id: null == id
? _value.id ? _self.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as String, as String,
null == state state: null == state
? _value.state ? _self.state
: state // ignore: cast_nullable_to_non_nullable : state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState, as MediumTrackingState,
null == title title: null == title
? _value.title ? _self.title
: title // ignore: cast_nullable_to_non_nullable : title // ignore: cast_nullable_to_non_nullable
as String, as String,
null == episodesWatched episodesWatched: null == episodesWatched
? _value.episodesWatched ? _self.episodesWatched
: episodesWatched // ignore: cast_nullable_to_non_nullable : episodesWatched // ignore: cast_nullable_to_non_nullable
as int, as int,
freezed == episodesTotal episodesTotal: freezed == episodesTotal
? _value.episodesTotal ? _self.episodesTotal
: episodesTotal // ignore: cast_nullable_to_non_nullable : episodesTotal // ignore: cast_nullable_to_non_nullable
as int?, as int?,
null == thumbnailUrl thumbnailUrl: null == thumbnailUrl
? _value.thumbnailUrl ? _self.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable : thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String, as String,
null == airing airing: null == airing
? _value.airing ? _self.airing
: airing // ignore: cast_nullable_to_non_nullable : airing // ignore: cast_nullable_to_non_nullable
as bool, as bool,
freezed == broadcastDay broadcastDay: freezed == broadcastDay
? _value.broadcastDay ? _self.broadcastDay
: broadcastDay // ignore: cast_nullable_to_non_nullable : broadcastDay // ignore: cast_nullable_to_non_nullable
as String?, as String?,
)); ));
} }
} }
/// Adds pattern-matching-related methods to [AnimeTrackingData].
extension AnimeTrackingDataPatterns on AnimeTrackingData {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_AnimeTrackingData value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeTrackingData() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_AnimeTrackingData value) $default,
) {
final _that = this;
switch (_that) {
case _AnimeTrackingData():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@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 null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@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 orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@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 _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int episodesWatched,
int? episodesTotal,
String thumbnailUrl,
@BoolConverter() bool airing,
String? broadcastDay)?
$default,
) {
final _that = this;
switch (_that) {
case _AnimeTrackingData() when $default != null:
return $default(
_that.id,
_that.state,
_that.title,
_that.episodesWatched,
_that.episodesTotal,
_that.thumbnailUrl,
_that.airing,
_that.broadcastDay);
case _:
return null;
}
}
}
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _$AnimeTrackingDataImpl implements _AnimeTrackingData { class _AnimeTrackingData extends AnimeTrackingData {
_$AnimeTrackingDataImpl( _AnimeTrackingData(
this.id, this.id,
@MediumTrackingStateConverter() this.state, @MediumTrackingStateConverter() this.state,
this.title, this.title,
@@ -223,10 +376,10 @@ class _$AnimeTrackingDataImpl implements _AnimeTrackingData {
this.episodesTotal, this.episodesTotal,
this.thumbnailUrl, this.thumbnailUrl,
@BoolConverter() this.airing, @BoolConverter() this.airing,
this.broadcastDay); this.broadcastDay)
: super._();
factory _$AnimeTrackingDataImpl.fromJson(Map<String, dynamic> json) => factory _AnimeTrackingData.fromJson(Map<String, dynamic> json) =>
_$$AnimeTrackingDataImplFromJson(json); _$AnimeTrackingDataFromJson(json);
/// The ID of the anime /// The ID of the anime
@override @override
@@ -262,16 +415,26 @@ class _$AnimeTrackingDataImpl implements _AnimeTrackingData {
@override @override
final String? broadcastDay; final String? broadcastDay;
/// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values.
@override @override
String toString() { @JsonKey(includeFromJson: false, includeToJson: false)
return 'AnimeTrackingData(id: $id, state: $state, title: $title, episodesWatched: $episodesWatched, episodesTotal: $episodesTotal, thumbnailUrl: $thumbnailUrl, airing: $airing, broadcastDay: $broadcastDay)'; @pragma('vm:prefer-inline')
_$AnimeTrackingDataCopyWith<_AnimeTrackingData> get copyWith =>
__$AnimeTrackingDataCopyWithImpl<_AnimeTrackingData>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$AnimeTrackingDataToJson(
this,
);
} }
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType &&
other is _$AnimeTrackingDataImpl && other is _AnimeTrackingData &&
(identical(other.id, id) || other.id == id) && (identical(other.id, id) || other.id == id) &&
(identical(other.state, state) || other.state == state) && (identical(other.state, state) || other.state == state) &&
(identical(other.title, title) || other.title == title) && (identical(other.title, title) || other.title == title) &&
@@ -291,75 +454,88 @@ class _$AnimeTrackingDataImpl implements _AnimeTrackingData {
int get hashCode => Object.hash(runtimeType, id, state, title, int get hashCode => Object.hash(runtimeType, id, state, title,
episodesWatched, episodesTotal, thumbnailUrl, airing, broadcastDay); episodesWatched, episodesTotal, thumbnailUrl, airing, broadcastDay);
/// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override @override
@pragma('vm:prefer-inline') String toString() {
_$$AnimeTrackingDataImplCopyWith<_$AnimeTrackingDataImpl> get copyWith => return 'AnimeTrackingData(id: $id, state: $state, title: $title, episodesWatched: $episodesWatched, episodesTotal: $episodesTotal, thumbnailUrl: $thumbnailUrl, airing: $airing, broadcastDay: $broadcastDay)';
__$$AnimeTrackingDataImplCopyWithImpl<_$AnimeTrackingDataImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$AnimeTrackingDataImplToJson(
this,
);
} }
} }
abstract class _AnimeTrackingData implements AnimeTrackingData { /// @nodoc
factory _AnimeTrackingData( abstract mixin class _$AnimeTrackingDataCopyWith<$Res>
final String id, implements $AnimeTrackingDataCopyWith<$Res> {
@MediumTrackingStateConverter() final MediumTrackingState state, factory _$AnimeTrackingDataCopyWith(
final String title, _AnimeTrackingData value, $Res Function(_AnimeTrackingData) _then) =
final int episodesWatched, __$AnimeTrackingDataCopyWithImpl;
final int? episodesTotal,
final String thumbnailUrl,
@BoolConverter() final bool airing,
final String? broadcastDay) = _$AnimeTrackingDataImpl;
factory _AnimeTrackingData.fromJson(Map<String, dynamic> json) =
_$AnimeTrackingDataImpl.fromJson;
/// The ID of the anime
@override @override
String get id; @useResult
$Res call(
{String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int episodesWatched,
int? episodesTotal,
String thumbnailUrl,
@BoolConverter() bool airing,
String? broadcastDay});
}
/// The state of the anime /// @nodoc
@override class __$AnimeTrackingDataCopyWithImpl<$Res>
@MediumTrackingStateConverter() implements _$AnimeTrackingDataCopyWith<$Res> {
MediumTrackingState get state; __$AnimeTrackingDataCopyWithImpl(this._self, this._then);
/// The title of the anime final _AnimeTrackingData _self;
@override final $Res Function(_AnimeTrackingData) _then;
String get title;
/// Episodes in total.
@override
int get episodesWatched;
/// Episodes watched.
@override
int? get episodesTotal;
/// URL to the thumbnail/cover art for the anime.
@override
String get thumbnailUrl;
/// Flag whether the anime is airing
@override
@BoolConverter()
bool get airing;
/// The day of the week the anime is airing
@override
String? get broadcastDay;
/// Create a copy of AnimeTrackingData /// Create a copy of AnimeTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@override @override
@JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline')
_$$AnimeTrackingDataImplCopyWith<_$AnimeTrackingDataImpl> get copyWith => $Res call({
throw _privateConstructorUsedError; 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
as String?,
));
}
} }
// dart format on

View File

@@ -6,9 +6,8 @@ part of 'anime.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_$AnimeTrackingDataImpl _$$AnimeTrackingDataImplFromJson( _AnimeTrackingData _$AnimeTrackingDataFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> json) => _AnimeTrackingData(
_$AnimeTrackingDataImpl(
json['id'] as String, json['id'] as String,
const MediumTrackingStateConverter() const MediumTrackingStateConverter()
.fromJson((json['state'] as num).toInt()), .fromJson((json['state'] as num).toInt()),
@@ -20,8 +19,7 @@ _$AnimeTrackingDataImpl _$$AnimeTrackingDataImplFromJson(
json['broadcastDay'] as String?, json['broadcastDay'] as String?,
); );
Map<String, dynamic> _$$AnimeTrackingDataImplToJson( Map<String, dynamic> _$AnimeTrackingDataToJson(_AnimeTrackingData instance) =>
_$AnimeTrackingDataImpl instance) =>
<String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'state': const MediumTrackingStateConverter().toJson(instance.state), 'state': const MediumTrackingStateConverter().toJson(instance.state),

View File

@@ -6,7 +6,7 @@ part 'manga.g.dart';
/// Data about a tracked anime /// Data about a tracked anime
@freezed @freezed
class MangaTrackingData with _$MangaTrackingData, TrackingMedium { abstract class MangaTrackingData with _$MangaTrackingData, TrackingMedium {
factory MangaTrackingData( factory MangaTrackingData(
/// The ID of the manga /// The ID of the manga
String id, String id,
@@ -30,6 +30,8 @@ class MangaTrackingData with _$MangaTrackingData, TrackingMedium {
String thumbnailUrl, String thumbnailUrl,
) = _MangaTrackingData; ) = _MangaTrackingData;
MangaTrackingData._();
/// JSON /// JSON
factory MangaTrackingData.fromJson(Map<String, dynamic> json) => factory MangaTrackingData.fromJson(Map<String, dynamic> json) =>
_$MangaTrackingDataFromJson(json); _$MangaTrackingDataFromJson(json);

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint // ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
@@ -9,128 +9,78 @@ part of 'manga.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
MangaTrackingData _$MangaTrackingDataFromJson(Map<String, dynamic> json) {
return _MangaTrackingData.fromJson(json);
}
/// @nodoc /// @nodoc
mixin _$MangaTrackingData { mixin _$MangaTrackingData {
/// The ID of the manga /// The ID of the manga
String get id => throw _privateConstructorUsedError; String get id;
/// The state of the manga /// The state of the manga
@MediumTrackingStateConverter() @MediumTrackingStateConverter()
MediumTrackingState get state => throw _privateConstructorUsedError; MediumTrackingState get state;
/// The title of the manga /// The title of the manga
String get title => throw _privateConstructorUsedError; String get title;
/// Chapters read. /// Chapters read.
int get chaptersRead => throw _privateConstructorUsedError; int get chaptersRead;
/// Chapters read. /// Chapters read.
int get volumesOwned => throw _privateConstructorUsedError; int get volumesOwned;
/// Episodes watched. /// Episodes watched.
int? get chaptersTotal => throw _privateConstructorUsedError; int? get chaptersTotal;
/// URL to the thumbnail/cover art for the manga. /// URL to the thumbnail/cover art for the manga.
String get thumbnailUrl => throw _privateConstructorUsedError; String get thumbnailUrl;
/// Serializes this MangaTrackingData to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of MangaTrackingData /// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
$MangaTrackingDataCopyWith<MangaTrackingData> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MangaTrackingDataCopyWith<$Res> {
factory $MangaTrackingDataCopyWith(
MangaTrackingData value, $Res Function(MangaTrackingData) then) =
_$MangaTrackingDataCopyWithImpl<$Res, MangaTrackingData>;
@useResult
$Res call(
{String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl});
}
/// @nodoc
class _$MangaTrackingDataCopyWithImpl<$Res, $Val extends MangaTrackingData>
implements $MangaTrackingDataCopyWith<$Res> {
_$MangaTrackingDataCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
$MangaTrackingDataCopyWith<MangaTrackingData> get copyWith =>
_$MangaTrackingDataCopyWithImpl<MangaTrackingData>(
this as MangaTrackingData, _$identity);
/// Serializes this MangaTrackingData to a JSON map.
Map<String, dynamic> toJson();
@override @override
$Res call({ bool operator ==(Object other) {
Object? id = null, return identical(this, other) ||
Object? state = null, (other.runtimeType == runtimeType &&
Object? title = null, other is MangaTrackingData &&
Object? chaptersRead = null, (identical(other.id, id) || other.id == id) &&
Object? volumesOwned = null, (identical(other.state, state) || other.state == state) &&
Object? chaptersTotal = freezed, (identical(other.title, title) || other.title == title) &&
Object? thumbnailUrl = null, (identical(other.chaptersRead, chaptersRead) ||
}) { other.chaptersRead == chaptersRead) &&
return _then(_value.copyWith( (identical(other.volumesOwned, volumesOwned) ||
id: null == id other.volumesOwned == volumesOwned) &&
? _value.id (identical(other.chaptersTotal, chaptersTotal) ||
: id // ignore: cast_nullable_to_non_nullable other.chaptersTotal == chaptersTotal) &&
as String, (identical(other.thumbnailUrl, thumbnailUrl) ||
state: null == state other.thumbnailUrl == thumbnailUrl));
? _value.state }
: state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState, @JsonKey(includeFromJson: false, includeToJson: false)
title: null == title @override
? _value.title int get hashCode => Object.hash(runtimeType, id, state, title, chaptersRead,
: title // ignore: cast_nullable_to_non_nullable volumesOwned, chaptersTotal, thumbnailUrl);
as String,
chaptersRead: null == chaptersRead @override
? _value.chaptersRead String toString() {
: chaptersRead // ignore: cast_nullable_to_non_nullable return 'MangaTrackingData(id: $id, state: $state, title: $title, chaptersRead: $chaptersRead, volumesOwned: $volumesOwned, chaptersTotal: $chaptersTotal, thumbnailUrl: $thumbnailUrl)';
as int,
volumesOwned: null == volumesOwned
? _value.volumesOwned
: volumesOwned // ignore: cast_nullable_to_non_nullable
as int,
chaptersTotal: freezed == chaptersTotal
? _value.chaptersTotal
: chaptersTotal // ignore: cast_nullable_to_non_nullable
as int?,
thumbnailUrl: null == thumbnailUrl
? _value.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
} }
} }
/// @nodoc /// @nodoc
abstract class _$$MangaTrackingDataImplCopyWith<$Res> abstract mixin class $MangaTrackingDataCopyWith<$Res> {
implements $MangaTrackingDataCopyWith<$Res> { factory $MangaTrackingDataCopyWith(
factory _$$MangaTrackingDataImplCopyWith(_$MangaTrackingDataImpl value, MangaTrackingData value, $Res Function(MangaTrackingData) _then) =
$Res Function(_$MangaTrackingDataImpl) then) = _$MangaTrackingDataCopyWithImpl;
__$$MangaTrackingDataImplCopyWithImpl<$Res>;
@override
@useResult @useResult
$Res call( $Res call(
{String id, {String id,
@@ -143,12 +93,12 @@ abstract class _$$MangaTrackingDataImplCopyWith<$Res>
} }
/// @nodoc /// @nodoc
class __$$MangaTrackingDataImplCopyWithImpl<$Res> class _$MangaTrackingDataCopyWithImpl<$Res>
extends _$MangaTrackingDataCopyWithImpl<$Res, _$MangaTrackingDataImpl> implements $MangaTrackingDataCopyWith<$Res> {
implements _$$MangaTrackingDataImplCopyWith<$Res> { _$MangaTrackingDataCopyWithImpl(this._self, this._then);
__$$MangaTrackingDataImplCopyWithImpl(_$MangaTrackingDataImpl _value,
$Res Function(_$MangaTrackingDataImpl) _then) final MangaTrackingData _self;
: super(_value, _then); final $Res Function(MangaTrackingData) _then;
/// Create a copy of MangaTrackingData /// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@@ -163,53 +113,237 @@ class __$$MangaTrackingDataImplCopyWithImpl<$Res>
Object? chaptersTotal = freezed, Object? chaptersTotal = freezed,
Object? thumbnailUrl = null, Object? thumbnailUrl = null,
}) { }) {
return _then(_$MangaTrackingDataImpl( return _then(_self.copyWith(
null == id id: null == id
? _value.id ? _self.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as String, as String,
null == state state: null == state
? _value.state ? _self.state
: state // ignore: cast_nullable_to_non_nullable : state // ignore: cast_nullable_to_non_nullable
as MediumTrackingState, as MediumTrackingState,
null == title title: null == title
? _value.title ? _self.title
: title // ignore: cast_nullable_to_non_nullable : title // ignore: cast_nullable_to_non_nullable
as String, as String,
null == chaptersRead chaptersRead: null == chaptersRead
? _value.chaptersRead ? _self.chaptersRead
: chaptersRead // ignore: cast_nullable_to_non_nullable : chaptersRead // ignore: cast_nullable_to_non_nullable
as int, as int,
null == volumesOwned volumesOwned: null == volumesOwned
? _value.volumesOwned ? _self.volumesOwned
: volumesOwned // ignore: cast_nullable_to_non_nullable : volumesOwned // ignore: cast_nullable_to_non_nullable
as int, as int,
freezed == chaptersTotal chaptersTotal: freezed == chaptersTotal
? _value.chaptersTotal ? _self.chaptersTotal
: chaptersTotal // ignore: cast_nullable_to_non_nullable : chaptersTotal // ignore: cast_nullable_to_non_nullable
as int?, as int?,
null == thumbnailUrl thumbnailUrl: null == thumbnailUrl
? _value.thumbnailUrl ? _self.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable : thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String, as String,
)); ));
} }
} }
/// Adds pattern-matching-related methods to [MangaTrackingData].
extension MangaTrackingDataPatterns on MangaTrackingData {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_MangaTrackingData value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _MangaTrackingData() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_MangaTrackingData value) $default,
) {
final _that = this;
switch (_that) {
case _MangaTrackingData():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@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 null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@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 orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@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 _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl)?
$default,
) {
final _that = this;
switch (_that) {
case _MangaTrackingData() when $default != null:
return $default(_that.id, _that.state, _that.title, _that.chaptersRead,
_that.volumesOwned, _that.chaptersTotal, _that.thumbnailUrl);
case _:
return null;
}
}
}
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _$MangaTrackingDataImpl implements _MangaTrackingData { class _MangaTrackingData extends MangaTrackingData {
_$MangaTrackingDataImpl( _MangaTrackingData(
this.id, this.id,
@MediumTrackingStateConverter() this.state, @MediumTrackingStateConverter() this.state,
this.title, this.title,
this.chaptersRead, this.chaptersRead,
this.volumesOwned, this.volumesOwned,
this.chaptersTotal, this.chaptersTotal,
this.thumbnailUrl); this.thumbnailUrl)
: super._();
factory _$MangaTrackingDataImpl.fromJson(Map<String, dynamic> json) => factory _MangaTrackingData.fromJson(Map<String, dynamic> json) =>
_$$MangaTrackingDataImplFromJson(json); _$MangaTrackingDataFromJson(json);
/// The ID of the manga /// The ID of the manga
@override @override
@@ -240,16 +374,26 @@ class _$MangaTrackingDataImpl implements _MangaTrackingData {
@override @override
final String thumbnailUrl; final String thumbnailUrl;
/// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values.
@override @override
String toString() { @JsonKey(includeFromJson: false, includeToJson: false)
return 'MangaTrackingData(id: $id, state: $state, title: $title, chaptersRead: $chaptersRead, volumesOwned: $volumesOwned, chaptersTotal: $chaptersTotal, thumbnailUrl: $thumbnailUrl)'; @pragma('vm:prefer-inline')
_$MangaTrackingDataCopyWith<_MangaTrackingData> get copyWith =>
__$MangaTrackingDataCopyWithImpl<_MangaTrackingData>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$MangaTrackingDataToJson(
this,
);
} }
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType &&
other is _$MangaTrackingDataImpl && other is _MangaTrackingData &&
(identical(other.id, id) || other.id == id) && (identical(other.id, id) || other.id == id) &&
(identical(other.state, state) || other.state == state) && (identical(other.state, state) || other.state == state) &&
(identical(other.title, title) || other.title == title) && (identical(other.title, title) || other.title == title) &&
@@ -268,69 +412,82 @@ class _$MangaTrackingDataImpl implements _MangaTrackingData {
int get hashCode => Object.hash(runtimeType, id, state, title, chaptersRead, int get hashCode => Object.hash(runtimeType, id, state, title, chaptersRead,
volumesOwned, chaptersTotal, thumbnailUrl); volumesOwned, chaptersTotal, thumbnailUrl);
/// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override @override
@pragma('vm:prefer-inline') String toString() {
_$$MangaTrackingDataImplCopyWith<_$MangaTrackingDataImpl> get copyWith => return 'MangaTrackingData(id: $id, state: $state, title: $title, chaptersRead: $chaptersRead, volumesOwned: $volumesOwned, chaptersTotal: $chaptersTotal, thumbnailUrl: $thumbnailUrl)';
__$$MangaTrackingDataImplCopyWithImpl<_$MangaTrackingDataImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$MangaTrackingDataImplToJson(
this,
);
} }
} }
abstract class _MangaTrackingData implements MangaTrackingData { /// @nodoc
factory _MangaTrackingData( abstract mixin class _$MangaTrackingDataCopyWith<$Res>
final String id, implements $MangaTrackingDataCopyWith<$Res> {
@MediumTrackingStateConverter() final MediumTrackingState state, factory _$MangaTrackingDataCopyWith(
final String title, _MangaTrackingData value, $Res Function(_MangaTrackingData) _then) =
final int chaptersRead, __$MangaTrackingDataCopyWithImpl;
final int volumesOwned,
final int? chaptersTotal,
final String thumbnailUrl) = _$MangaTrackingDataImpl;
factory _MangaTrackingData.fromJson(Map<String, dynamic> json) =
_$MangaTrackingDataImpl.fromJson;
/// The ID of the manga
@override @override
String get id; @useResult
$Res call(
{String id,
@MediumTrackingStateConverter() MediumTrackingState state,
String title,
int chaptersRead,
int volumesOwned,
int? chaptersTotal,
String thumbnailUrl});
}
/// The state of the manga /// @nodoc
@override class __$MangaTrackingDataCopyWithImpl<$Res>
@MediumTrackingStateConverter() implements _$MangaTrackingDataCopyWith<$Res> {
MediumTrackingState get state; __$MangaTrackingDataCopyWithImpl(this._self, this._then);
/// The title of the manga final _MangaTrackingData _self;
@override final $Res Function(_MangaTrackingData) _then;
String get title;
/// Chapters read.
@override
int get chaptersRead;
/// Chapters read.
@override
int get volumesOwned;
/// Episodes watched.
@override
int? get chaptersTotal;
/// URL to the thumbnail/cover art for the manga.
@override
String get thumbnailUrl;
/// Create a copy of MangaTrackingData /// Create a copy of MangaTrackingData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@override @override
@JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline')
_$$MangaTrackingDataImplCopyWith<_$MangaTrackingDataImpl> get copyWith => $Res call({
throw _privateConstructorUsedError; 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
as String,
));
}
} }
// dart format on

View File

@@ -6,9 +6,8 @@ part of 'manga.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_$MangaTrackingDataImpl _$$MangaTrackingDataImplFromJson( _MangaTrackingData _$MangaTrackingDataFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> json) => _MangaTrackingData(
_$MangaTrackingDataImpl(
json['id'] as String, json['id'] as String,
const MediumTrackingStateConverter() const MediumTrackingStateConverter()
.fromJson((json['state'] as num).toInt()), .fromJson((json['state'] as num).toInt()),
@@ -19,8 +18,7 @@ _$MangaTrackingDataImpl _$$MangaTrackingDataImplFromJson(
json['thumbnailUrl'] as String, json['thumbnailUrl'] as String,
); );
Map<String, dynamic> _$$MangaTrackingDataImplToJson( Map<String, dynamic> _$MangaTrackingDataToJson(_MangaTrackingData instance) =>
_$MangaTrackingDataImpl instance) =>
<String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'state': const MediumTrackingStateConverter().toJson(instance.state), 'state': const MediumTrackingStateConverter().toJson(instance.state),

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint // ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
@@ -9,102 +9,64 @@ part of 'anime_list_bloc.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc /// @nodoc
mixin _$AnimeListState { mixin _$AnimeListState {
bool get buttonVisibility => throw _privateConstructorUsedError; bool get buttonVisibility;
List<AnimeTrackingData> get animes => throw _privateConstructorUsedError; List<AnimeTrackingData> get animes;
List<MangaTrackingData> get mangas => throw _privateConstructorUsedError; List<MangaTrackingData> get mangas;
MediumTrackingState get animeFilterState => MediumTrackingState get animeFilterState;
throw _privateConstructorUsedError; MediumTrackingState get mangaFilterState;
MediumTrackingState get mangaFilterState => TrackingMediumType get trackingType;
throw _privateConstructorUsedError;
TrackingMediumType get trackingType => throw _privateConstructorUsedError;
/// Create a copy of AnimeListState /// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
$AnimeListStateCopyWith<AnimeListState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $AnimeListStateCopyWith<$Res> {
factory $AnimeListStateCopyWith(
AnimeListState value, $Res Function(AnimeListState) then) =
_$AnimeListStateCopyWithImpl<$Res, AnimeListState>;
@useResult
$Res call(
{bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType});
}
/// @nodoc
class _$AnimeListStateCopyWithImpl<$Res, $Val extends AnimeListState>
implements $AnimeListStateCopyWith<$Res> {
_$AnimeListStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
$AnimeListStateCopyWith<AnimeListState> get copyWith =>
_$AnimeListStateCopyWithImpl<AnimeListState>(
this as AnimeListState, _$identity);
@override @override
$Res call({ bool operator ==(Object other) {
Object? buttonVisibility = null, return identical(this, other) ||
Object? animes = null, (other.runtimeType == runtimeType &&
Object? mangas = null, other is AnimeListState &&
Object? animeFilterState = null, (identical(other.buttonVisibility, buttonVisibility) ||
Object? mangaFilterState = null, other.buttonVisibility == buttonVisibility) &&
Object? trackingType = null, const DeepCollectionEquality().equals(other.animes, animes) &&
}) { const DeepCollectionEquality().equals(other.mangas, mangas) &&
return _then(_value.copyWith( (identical(other.animeFilterState, animeFilterState) ||
buttonVisibility: null == buttonVisibility other.animeFilterState == animeFilterState) &&
? _value.buttonVisibility (identical(other.mangaFilterState, mangaFilterState) ||
: buttonVisibility // ignore: cast_nullable_to_non_nullable other.mangaFilterState == mangaFilterState) &&
as bool, (identical(other.trackingType, trackingType) ||
animes: null == animes other.trackingType == trackingType));
? _value.animes }
: animes // ignore: cast_nullable_to_non_nullable
as List<AnimeTrackingData>, @override
mangas: null == mangas int get hashCode => Object.hash(
? _value.mangas runtimeType,
: mangas // ignore: cast_nullable_to_non_nullable buttonVisibility,
as List<MangaTrackingData>, const DeepCollectionEquality().hash(animes),
animeFilterState: null == animeFilterState const DeepCollectionEquality().hash(mangas),
? _value.animeFilterState animeFilterState,
: animeFilterState // ignore: cast_nullable_to_non_nullable mangaFilterState,
as MediumTrackingState, trackingType);
mangaFilterState: null == mangaFilterState
? _value.mangaFilterState @override
: mangaFilterState // ignore: cast_nullable_to_non_nullable String toString() {
as MediumTrackingState, return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)';
trackingType: null == trackingType
? _value.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
) as $Val);
} }
} }
/// @nodoc /// @nodoc
abstract class _$$AnimeListStateImplCopyWith<$Res> abstract mixin class $AnimeListStateCopyWith<$Res> {
implements $AnimeListStateCopyWith<$Res> { factory $AnimeListStateCopyWith(
factory _$$AnimeListStateImplCopyWith(_$AnimeListStateImpl value, AnimeListState value, $Res Function(AnimeListState) _then) =
$Res Function(_$AnimeListStateImpl) then) = _$AnimeListStateCopyWithImpl;
__$$AnimeListStateImplCopyWithImpl<$Res>;
@override
@useResult @useResult
$Res call( $Res call(
{bool buttonVisibility, {bool buttonVisibility,
@@ -116,12 +78,12 @@ abstract class _$$AnimeListStateImplCopyWith<$Res>
} }
/// @nodoc /// @nodoc
class __$$AnimeListStateImplCopyWithImpl<$Res> class _$AnimeListStateCopyWithImpl<$Res>
extends _$AnimeListStateCopyWithImpl<$Res, _$AnimeListStateImpl> implements $AnimeListStateCopyWith<$Res> {
implements _$$AnimeListStateImplCopyWith<$Res> { _$AnimeListStateCopyWithImpl(this._self, this._then);
__$$AnimeListStateImplCopyWithImpl(
_$AnimeListStateImpl _value, $Res Function(_$AnimeListStateImpl) _then) final AnimeListState _self;
: super(_value, _then); final $Res Function(AnimeListState) _then;
/// Create a copy of AnimeListState /// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@@ -135,39 +97,220 @@ class __$$AnimeListStateImplCopyWithImpl<$Res>
Object? mangaFilterState = null, Object? mangaFilterState = null,
Object? trackingType = null, Object? trackingType = null,
}) { }) {
return _then(_$AnimeListStateImpl( return _then(_self.copyWith(
buttonVisibility: null == buttonVisibility buttonVisibility: null == buttonVisibility
? _value.buttonVisibility ? _self.buttonVisibility
: buttonVisibility // ignore: cast_nullable_to_non_nullable : buttonVisibility // ignore: cast_nullable_to_non_nullable
as bool, as bool,
animes: null == animes animes: null == animes
? _value._animes ? _self.animes
: animes // ignore: cast_nullable_to_non_nullable : animes // ignore: cast_nullable_to_non_nullable
as List<AnimeTrackingData>, as List<AnimeTrackingData>,
mangas: null == mangas mangas: null == mangas
? _value._mangas ? _self.mangas
: mangas // ignore: cast_nullable_to_non_nullable : mangas // ignore: cast_nullable_to_non_nullable
as List<MangaTrackingData>, as List<MangaTrackingData>,
animeFilterState: null == animeFilterState animeFilterState: null == animeFilterState
? _value.animeFilterState ? _self.animeFilterState
: animeFilterState // ignore: cast_nullable_to_non_nullable : animeFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState, as MediumTrackingState,
mangaFilterState: null == mangaFilterState mangaFilterState: null == mangaFilterState
? _value.mangaFilterState ? _self.mangaFilterState
: mangaFilterState // ignore: cast_nullable_to_non_nullable : mangaFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState, as MediumTrackingState,
trackingType: null == trackingType trackingType: null == trackingType
? _value.trackingType ? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType, as TrackingMediumType,
)); ));
} }
} }
/// Adds pattern-matching-related methods to [AnimeListState].
extension AnimeListStatePatterns on AnimeListState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_AnimeListState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_AnimeListState value) $default,
) {
final _that = this;
switch (_that) {
case _AnimeListState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_AnimeListState value)? $default,
) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(
bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(
bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType)
$default,
) {
final _that = this;
switch (_that) {
case _AnimeListState():
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
bool buttonVisibility,
List<AnimeTrackingData> animes,
List<MangaTrackingData> mangas,
MediumTrackingState animeFilterState,
MediumTrackingState mangaFilterState,
TrackingMediumType trackingType)?
$default,
) {
final _that = this;
switch (_that) {
case _AnimeListState() when $default != null:
return $default(_that.buttonVisibility, _that.animes, _that.mangas,
_that.animeFilterState, _that.mangaFilterState, _that.trackingType);
case _:
return null;
}
}
}
/// @nodoc /// @nodoc
class _$AnimeListStateImpl implements _AnimeListState { class _AnimeListState implements AnimeListState {
_$AnimeListStateImpl( _AnimeListState(
{this.buttonVisibility = true, {this.buttonVisibility = true,
final List<AnimeTrackingData> animes = const [], final List<AnimeTrackingData> animes = const [],
final List<MangaTrackingData> mangas = const [], final List<MangaTrackingData> mangas = const [],
@@ -208,16 +351,19 @@ class _$AnimeListStateImpl implements _AnimeListState {
@JsonKey() @JsonKey()
final TrackingMediumType trackingType; final TrackingMediumType trackingType;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@override @override
String toString() { @JsonKey(includeFromJson: false, includeToJson: false)
return 'AnimeListState(buttonVisibility: $buttonVisibility, animes: $animes, mangas: $mangas, animeFilterState: $animeFilterState, mangaFilterState: $mangaFilterState, trackingType: $trackingType)'; @pragma('vm:prefer-inline')
} _$AnimeListStateCopyWith<_AnimeListState> get copyWith =>
__$AnimeListStateCopyWithImpl<_AnimeListState>(this, _$identity);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType &&
other is _$AnimeListStateImpl && other is _AnimeListState &&
(identical(other.buttonVisibility, buttonVisibility) || (identical(other.buttonVisibility, buttonVisibility) ||
other.buttonVisibility == buttonVisibility) && other.buttonVisibility == buttonVisibility) &&
const DeepCollectionEquality().equals(other._animes, _animes) && const DeepCollectionEquality().equals(other._animes, _animes) &&
@@ -240,42 +386,76 @@ class _$AnimeListStateImpl implements _AnimeListState {
mangaFilterState, mangaFilterState,
trackingType); 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});
}
/// @nodoc
class __$AnimeListStateCopyWithImpl<$Res>
implements _$AnimeListStateCopyWith<$Res> {
__$AnimeListStateCopyWithImpl(this._self, this._then);
final _AnimeListState _self;
final $Res Function(_AnimeListState) _then;
/// Create a copy of AnimeListState /// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override @override
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
_$$AnimeListStateImplCopyWith<_$AnimeListStateImpl> get copyWith => $Res call({
__$$AnimeListStateImplCopyWithImpl<_$AnimeListStateImpl>( Object? buttonVisibility = null,
this, _$identity); Object? animes = null,
Object? mangas = null,
Object? animeFilterState = null,
Object? mangaFilterState = null,
Object? trackingType = null,
}) {
return _then(_AnimeListState(
buttonVisibility: null == buttonVisibility
? _self.buttonVisibility
: buttonVisibility // ignore: cast_nullable_to_non_nullable
as bool,
animes: null == animes
? _self._animes
: animes // ignore: cast_nullable_to_non_nullable
as List<AnimeTrackingData>,
mangas: null == mangas
? _self._mangas
: mangas // ignore: cast_nullable_to_non_nullable
as List<MangaTrackingData>,
animeFilterState: null == animeFilterState
? _self.animeFilterState
: animeFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
mangaFilterState: null == mangaFilterState
? _self.mangaFilterState
: mangaFilterState // ignore: cast_nullable_to_non_nullable
as MediumTrackingState,
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
} }
abstract class _AnimeListState implements AnimeListState { // dart format on
factory _AnimeListState(
{final bool buttonVisibility,
final List<AnimeTrackingData> animes,
final List<MangaTrackingData> mangas,
final MediumTrackingState animeFilterState,
final MediumTrackingState mangaFilterState,
final TrackingMediumType trackingType}) = _$AnimeListStateImpl;
@override
bool get buttonVisibility;
@override
List<AnimeTrackingData> get animes;
@override
List<MangaTrackingData> get mangas;
@override
MediumTrackingState get animeFilterState;
@override
MediumTrackingState get mangaFilterState;
@override
TrackingMediumType get trackingType;
/// Create a copy of AnimeListState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AnimeListStateImplCopyWith<_$AnimeListStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,7 +1,7 @@
part of 'anime_list_bloc.dart'; part of 'anime_list_bloc.dart';
@freezed @freezed
class AnimeListState with _$AnimeListState { abstract class AnimeListState with _$AnimeListState {
factory AnimeListState({ factory AnimeListState({
@Default(true) bool buttonVisibility, @Default(true) bool buttonVisibility,
@Default([]) List<AnimeTrackingData> animes, @Default([]) List<AnimeTrackingData> animes,

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint // ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
@@ -9,86 +9,53 @@ part of 'anime_search_bloc.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc /// @nodoc
mixin _$AnimeSearchState { mixin _$AnimeSearchState {
TrackingMediumType get trackingType => throw _privateConstructorUsedError; TrackingMediumType get trackingType;
String get searchQuery => throw _privateConstructorUsedError; String get searchQuery;
bool get working => throw _privateConstructorUsedError; bool get working;
List<SearchResult> get searchResults => throw _privateConstructorUsedError; List<SearchResult> get searchResults;
/// Create a copy of AnimeSearchState /// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
$AnimeSearchStateCopyWith<AnimeSearchState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $AnimeSearchStateCopyWith<$Res> {
factory $AnimeSearchStateCopyWith(
AnimeSearchState value, $Res Function(AnimeSearchState) then) =
_$AnimeSearchStateCopyWithImpl<$Res, AnimeSearchState>;
@useResult
$Res call(
{TrackingMediumType trackingType,
String searchQuery,
bool working,
List<SearchResult> searchResults});
}
/// @nodoc
class _$AnimeSearchStateCopyWithImpl<$Res, $Val extends AnimeSearchState>
implements $AnimeSearchStateCopyWith<$Res> {
_$AnimeSearchStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
$AnimeSearchStateCopyWith<AnimeSearchState> get copyWith =>
_$AnimeSearchStateCopyWithImpl<AnimeSearchState>(
this as AnimeSearchState, _$identity);
@override @override
$Res call({ bool operator ==(Object other) {
Object? trackingType = null, return identical(this, other) ||
Object? searchQuery = null, (other.runtimeType == runtimeType &&
Object? working = null, other is AnimeSearchState &&
Object? searchResults = null, (identical(other.trackingType, trackingType) ||
}) { other.trackingType == trackingType) &&
return _then(_value.copyWith( (identical(other.searchQuery, searchQuery) ||
trackingType: null == trackingType other.searchQuery == searchQuery) &&
? _value.trackingType (identical(other.working, working) || other.working == working) &&
: trackingType // ignore: cast_nullable_to_non_nullable const DeepCollectionEquality()
as TrackingMediumType, .equals(other.searchResults, searchResults));
searchQuery: null == searchQuery }
? _value.searchQuery
: searchQuery // ignore: cast_nullable_to_non_nullable @override
as String, int get hashCode => Object.hash(runtimeType, trackingType, searchQuery,
working: null == working working, const DeepCollectionEquality().hash(searchResults));
? _value.working
: working // ignore: cast_nullable_to_non_nullable @override
as bool, String toString() {
searchResults: null == searchResults return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)';
? _value.searchResults
: searchResults // ignore: cast_nullable_to_non_nullable
as List<SearchResult>,
) as $Val);
} }
} }
/// @nodoc /// @nodoc
abstract class _$$AnimeSearchStateImplCopyWith<$Res> abstract mixin class $AnimeSearchStateCopyWith<$Res> {
implements $AnimeSearchStateCopyWith<$Res> { factory $AnimeSearchStateCopyWith(
factory _$$AnimeSearchStateImplCopyWith(_$AnimeSearchStateImpl value, AnimeSearchState value, $Res Function(AnimeSearchState) _then) =
$Res Function(_$AnimeSearchStateImpl) then) = _$AnimeSearchStateCopyWithImpl;
__$$AnimeSearchStateImplCopyWithImpl<$Res>;
@override
@useResult @useResult
$Res call( $Res call(
{TrackingMediumType trackingType, {TrackingMediumType trackingType,
@@ -98,12 +65,12 @@ abstract class _$$AnimeSearchStateImplCopyWith<$Res>
} }
/// @nodoc /// @nodoc
class __$$AnimeSearchStateImplCopyWithImpl<$Res> class _$AnimeSearchStateCopyWithImpl<$Res>
extends _$AnimeSearchStateCopyWithImpl<$Res, _$AnimeSearchStateImpl> implements $AnimeSearchStateCopyWith<$Res> {
implements _$$AnimeSearchStateImplCopyWith<$Res> { _$AnimeSearchStateCopyWithImpl(this._self, this._then);
__$$AnimeSearchStateImplCopyWithImpl(_$AnimeSearchStateImpl _value,
$Res Function(_$AnimeSearchStateImpl) _then) final AnimeSearchState _self;
: super(_value, _then); final $Res Function(AnimeSearchState) _then;
/// Create a copy of AnimeSearchState /// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@@ -115,31 +82,197 @@ class __$$AnimeSearchStateImplCopyWithImpl<$Res>
Object? working = null, Object? working = null,
Object? searchResults = null, Object? searchResults = null,
}) { }) {
return _then(_$AnimeSearchStateImpl( return _then(_self.copyWith(
trackingType: null == trackingType trackingType: null == trackingType
? _value.trackingType ? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType, as TrackingMediumType,
searchQuery: null == searchQuery searchQuery: null == searchQuery
? _value.searchQuery ? _self.searchQuery
: searchQuery // ignore: cast_nullable_to_non_nullable : searchQuery // ignore: cast_nullable_to_non_nullable
as String, as String,
working: null == working working: null == working
? _value.working ? _self.working
: working // ignore: cast_nullable_to_non_nullable : working // ignore: cast_nullable_to_non_nullable
as bool, as bool,
searchResults: null == searchResults searchResults: null == searchResults
? _value._searchResults ? _self.searchResults
: searchResults // ignore: cast_nullable_to_non_nullable : searchResults // ignore: cast_nullable_to_non_nullable
as List<SearchResult>, as List<SearchResult>,
)); ));
} }
} }
/// Adds pattern-matching-related methods to [AnimeSearchState].
extension AnimeSearchStatePatterns on AnimeSearchState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_AnimeSearchState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_AnimeSearchState value) $default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_AnimeSearchState value)? $default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(TrackingMediumType trackingType, String searchQuery,
bool working, List<SearchResult> searchResults)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that.trackingType, _that.searchQuery, _that.working,
_that.searchResults);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(TrackingMediumType trackingType, String searchQuery,
bool working, List<SearchResult> searchResults)
$default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState():
return $default(_that.trackingType, _that.searchQuery, _that.working,
_that.searchResults);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(TrackingMediumType trackingType, String searchQuery,
bool working, List<SearchResult> searchResults)?
$default,
) {
final _that = this;
switch (_that) {
case _AnimeSearchState() when $default != null:
return $default(_that.trackingType, _that.searchQuery, _that.working,
_that.searchResults);
case _:
return null;
}
}
}
/// @nodoc /// @nodoc
class _$AnimeSearchStateImpl implements _AnimeSearchState { class _AnimeSearchState implements AnimeSearchState {
_$AnimeSearchStateImpl( _AnimeSearchState(
{this.trackingType = TrackingMediumType.anime, {this.trackingType = TrackingMediumType.anime,
this.searchQuery = '', this.searchQuery = '',
this.working = false, this.working = false,
@@ -164,16 +297,19 @@ class _$AnimeSearchStateImpl implements _AnimeSearchState {
return EqualUnmodifiableListView(_searchResults); return EqualUnmodifiableListView(_searchResults);
} }
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@override @override
String toString() { @JsonKey(includeFromJson: false, includeToJson: false)
return 'AnimeSearchState(trackingType: $trackingType, searchQuery: $searchQuery, working: $working, searchResults: $searchResults)'; @pragma('vm:prefer-inline')
} _$AnimeSearchStateCopyWith<_AnimeSearchState> get copyWith =>
__$AnimeSearchStateCopyWithImpl<_AnimeSearchState>(this, _$identity);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType &&
other is _$AnimeSearchStateImpl && other is _AnimeSearchState &&
(identical(other.trackingType, trackingType) || (identical(other.trackingType, trackingType) ||
other.trackingType == trackingType) && other.trackingType == trackingType) &&
(identical(other.searchQuery, searchQuery) || (identical(other.searchQuery, searchQuery) ||
@@ -187,36 +323,64 @@ class _$AnimeSearchStateImpl implements _AnimeSearchState {
int get hashCode => Object.hash(runtimeType, trackingType, searchQuery, int get hashCode => Object.hash(runtimeType, trackingType, searchQuery,
working, const DeepCollectionEquality().hash(_searchResults)); 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});
}
/// @nodoc
class __$AnimeSearchStateCopyWithImpl<$Res>
implements _$AnimeSearchStateCopyWith<$Res> {
__$AnimeSearchStateCopyWithImpl(this._self, this._then);
final _AnimeSearchState _self;
final $Res Function(_AnimeSearchState) _then;
/// Create a copy of AnimeSearchState /// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override @override
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
_$$AnimeSearchStateImplCopyWith<_$AnimeSearchStateImpl> get copyWith => $Res call({
__$$AnimeSearchStateImplCopyWithImpl<_$AnimeSearchStateImpl>( Object? trackingType = null,
this, _$identity); Object? searchQuery = null,
Object? working = null,
Object? searchResults = null,
}) {
return _then(_AnimeSearchState(
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
searchQuery: null == searchQuery
? _self.searchQuery
: searchQuery // ignore: cast_nullable_to_non_nullable
as String,
working: null == working
? _self.working
: working // ignore: cast_nullable_to_non_nullable
as bool,
searchResults: null == searchResults
? _self._searchResults
: searchResults // ignore: cast_nullable_to_non_nullable
as List<SearchResult>,
));
}
} }
abstract class _AnimeSearchState implements AnimeSearchState { // dart format on
factory _AnimeSearchState(
{final TrackingMediumType trackingType,
final String searchQuery,
final bool working,
final List<SearchResult> searchResults}) = _$AnimeSearchStateImpl;
@override
TrackingMediumType get trackingType;
@override
String get searchQuery;
@override
bool get working;
@override
List<SearchResult> get searchResults;
/// Create a copy of AnimeSearchState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AnimeSearchStateImplCopyWith<_$AnimeSearchStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,7 +1,7 @@
part of 'anime_search_bloc.dart'; part of 'anime_search_bloc.dart';
@freezed @freezed
class AnimeSearchState with _$AnimeSearchState { abstract class AnimeSearchState with _$AnimeSearchState {
factory AnimeSearchState({ factory AnimeSearchState({
@Default(TrackingMediumType.anime) TrackingMediumType trackingType, @Default(TrackingMediumType.anime) TrackingMediumType trackingType,
@Default('') String searchQuery, @Default('') String searchQuery,

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint // ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
@@ -9,137 +9,28 @@ part of 'calendar_bloc.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc /// @nodoc
mixin _$CalendarState { mixin _$CalendarState {
bool get refreshing => throw _privateConstructorUsedError; bool get refreshing;
int get refreshingCount => throw _privateConstructorUsedError; int get refreshingCount;
int get refreshingTotal => throw _privateConstructorUsedError; int get refreshingTotal;
/// Create a copy of CalendarState /// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$CalendarStateCopyWith<CalendarState> get copyWith => $CalendarStateCopyWith<CalendarState> get copyWith =>
throw _privateConstructorUsedError; _$CalendarStateCopyWithImpl<CalendarState>(
} this as CalendarState, _$identity);
/// @nodoc
abstract class $CalendarStateCopyWith<$Res> {
factory $CalendarStateCopyWith(
CalendarState value, $Res Function(CalendarState) then) =
_$CalendarStateCopyWithImpl<$Res, CalendarState>;
@useResult
$Res call({bool refreshing, int refreshingCount, int refreshingTotal});
}
/// @nodoc
class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState>
implements $CalendarStateCopyWith<$Res> {
_$CalendarStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? refreshing = null,
Object? refreshingCount = null,
Object? refreshingTotal = null,
}) {
return _then(_value.copyWith(
refreshing: null == refreshing
? _value.refreshing
: refreshing // ignore: cast_nullable_to_non_nullable
as bool,
refreshingCount: null == refreshingCount
? _value.refreshingCount
: refreshingCount // ignore: cast_nullable_to_non_nullable
as int,
refreshingTotal: null == refreshingTotal
? _value.refreshingTotal
: refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$CalendarStateImplCopyWith<$Res>
implements $CalendarStateCopyWith<$Res> {
factory _$$CalendarStateImplCopyWith(
_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) =
__$$CalendarStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({bool refreshing, int refreshingCount, int refreshingTotal});
}
/// @nodoc
class __$$CalendarStateImplCopyWithImpl<$Res>
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl>
implements _$$CalendarStateImplCopyWith<$Res> {
__$$CalendarStateImplCopyWithImpl(
_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then)
: super(_value, _then);
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? refreshing = null,
Object? refreshingCount = null,
Object? refreshingTotal = null,
}) {
return _then(_$CalendarStateImpl(
null == refreshing
? _value.refreshing
: refreshing // ignore: cast_nullable_to_non_nullable
as bool,
null == refreshingCount
? _value.refreshingCount
: refreshingCount // ignore: cast_nullable_to_non_nullable
as int,
null == refreshingTotal
? _value.refreshingTotal
: refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
class _$CalendarStateImpl implements _CalendarState {
_$CalendarStateImpl(
this.refreshing, this.refreshingCount, this.refreshingTotal);
@override
final bool refreshing;
@override
final int refreshingCount;
@override
final int refreshingTotal;
@override
String toString() {
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
}
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType &&
other is _$CalendarStateImpl && other is CalendarState &&
(identical(other.refreshing, refreshing) || (identical(other.refreshing, refreshing) ||
other.refreshing == refreshing) && other.refreshing == refreshing) &&
(identical(other.refreshingCount, refreshingCount) || (identical(other.refreshingCount, refreshingCount) ||
@@ -152,30 +43,305 @@ class _$CalendarStateImpl implements _CalendarState {
int get hashCode => int get hashCode =>
Object.hash(runtimeType, refreshing, refreshingCount, refreshingTotal); Object.hash(runtimeType, refreshing, refreshingCount, refreshingTotal);
@override
String toString() {
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
}
}
/// @nodoc
abstract mixin class $CalendarStateCopyWith<$Res> {
factory $CalendarStateCopyWith(
CalendarState value, $Res Function(CalendarState) _then) =
_$CalendarStateCopyWithImpl;
@useResult
$Res call({bool refreshing, int refreshingCount, int refreshingTotal});
}
/// @nodoc
class _$CalendarStateCopyWithImpl<$Res>
implements $CalendarStateCopyWith<$Res> {
_$CalendarStateCopyWithImpl(this._self, this._then);
final CalendarState _self;
final $Res Function(CalendarState) _then;
/// Create a copy of CalendarState /// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? refreshing = null,
Object? refreshingCount = null,
Object? refreshingTotal = null,
}) {
return _then(_self.copyWith(
refreshing: null == refreshing
? _self.refreshing
: refreshing // ignore: cast_nullable_to_non_nullable
as bool,
refreshingCount: null == refreshingCount
? _self.refreshingCount
: refreshingCount // ignore: cast_nullable_to_non_nullable
as int,
refreshingTotal: null == refreshingTotal
? _self.refreshingTotal
: refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// Adds pattern-matching-related methods to [CalendarState].
extension CalendarStatePatterns on CalendarState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_CalendarState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_CalendarState value) $default,
) {
final _that = this;
switch (_that) {
case _CalendarState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_CalendarState value)? $default,
) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(bool refreshing, int refreshingCount, int refreshingTotal)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(bool refreshing, int refreshingCount, int refreshingTotal)
$default,
) {
final _that = this;
switch (_that) {
case _CalendarState():
return $default(
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
bool refreshing, int refreshingCount, int refreshingTotal)?
$default,
) {
final _that = this;
switch (_that) {
case _CalendarState() when $default != null:
return $default(
_that.refreshing, _that.refreshingCount, _that.refreshingTotal);
case _:
return null;
}
}
}
/// @nodoc
class _CalendarState implements CalendarState {
_CalendarState(this.refreshing, this.refreshingCount, this.refreshingTotal);
@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) @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$CalendarStateCopyWith<_CalendarState> get copyWith =>
__$CalendarStateCopyWithImpl<_CalendarState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _CalendarState &&
(identical(other.refreshing, refreshing) ||
other.refreshing == refreshing) &&
(identical(other.refreshingCount, refreshingCount) ||
other.refreshingCount == refreshingCount) &&
(identical(other.refreshingTotal, refreshingTotal) ||
other.refreshingTotal == refreshingTotal));
}
@override
int get hashCode =>
Object.hash(runtimeType, refreshing, refreshingCount, refreshingTotal);
@override
String toString() {
return 'CalendarState(refreshing: $refreshing, refreshingCount: $refreshingCount, refreshingTotal: $refreshingTotal)';
}
}
/// @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});
}
/// @nodoc
class __$CalendarStateCopyWithImpl<$Res>
implements _$CalendarStateCopyWith<$Res> {
__$CalendarStateCopyWithImpl(this._self, this._then);
final _CalendarState _self;
final $Res Function(_CalendarState) _then;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@override @override
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
_$$CalendarStateImplCopyWith<_$CalendarStateImpl> get copyWith => $Res call({
__$$CalendarStateImplCopyWithImpl<_$CalendarStateImpl>(this, _$identity); Object? refreshing = null,
Object? refreshingCount = null,
Object? refreshingTotal = null,
}) {
return _then(_CalendarState(
null == refreshing
? _self.refreshing
: refreshing // ignore: cast_nullable_to_non_nullable
as bool,
null == refreshingCount
? _self.refreshingCount
: refreshingCount // ignore: cast_nullable_to_non_nullable
as int,
null == refreshingTotal
? _self.refreshingTotal
: refreshingTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
} }
abstract class _CalendarState implements CalendarState { // dart format on
factory _CalendarState(final bool refreshing, final int refreshingCount,
final int refreshingTotal) = _$CalendarStateImpl;
@override
bool get refreshing;
@override
int get refreshingCount;
@override
int get refreshingTotal;
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$CalendarStateImplCopyWith<_$CalendarStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,7 +1,7 @@
part of 'calendar_bloc.dart'; part of 'calendar_bloc.dart';
@freezed @freezed
class CalendarState with _$CalendarState { abstract class CalendarState with _$CalendarState {
factory CalendarState( factory CalendarState(
bool refreshing, bool refreshing,
int refreshingCount, int refreshingCount,

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint // ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
@@ -9,79 +9,50 @@ part of 'details_bloc.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc /// @nodoc
mixin _$DetailsState { mixin _$DetailsState {
TrackingMedium? get data => throw _privateConstructorUsedError; TrackingMedium? get data;
String? get heroImagePrefix => throw _privateConstructorUsedError; String? get heroImagePrefix;
TrackingMediumType get trackingType => throw _privateConstructorUsedError; TrackingMediumType get trackingType;
/// Create a copy of DetailsState /// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
$DetailsStateCopyWith<DetailsState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $DetailsStateCopyWith<$Res> {
factory $DetailsStateCopyWith(
DetailsState value, $Res Function(DetailsState) then) =
_$DetailsStateCopyWithImpl<$Res, DetailsState>;
@useResult
$Res call(
{TrackingMedium? data,
String? heroImagePrefix,
TrackingMediumType trackingType});
}
/// @nodoc
class _$DetailsStateCopyWithImpl<$Res, $Val extends DetailsState>
implements $DetailsStateCopyWith<$Res> {
_$DetailsStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
$DetailsStateCopyWith<DetailsState> get copyWith =>
_$DetailsStateCopyWithImpl<DetailsState>(
this as DetailsState, _$identity);
@override @override
$Res call({ bool operator ==(Object other) {
Object? data = freezed, return identical(this, other) ||
Object? heroImagePrefix = freezed, (other.runtimeType == runtimeType &&
Object? trackingType = null, other is DetailsState &&
}) { (identical(other.data, data) || other.data == data) &&
return _then(_value.copyWith( (identical(other.heroImagePrefix, heroImagePrefix) ||
data: freezed == data other.heroImagePrefix == heroImagePrefix) &&
? _value.data (identical(other.trackingType, trackingType) ||
: data // ignore: cast_nullable_to_non_nullable other.trackingType == trackingType));
as TrackingMedium?, }
heroImagePrefix: freezed == heroImagePrefix
? _value.heroImagePrefix @override
: heroImagePrefix // ignore: cast_nullable_to_non_nullable int get hashCode =>
as String?, Object.hash(runtimeType, data, heroImagePrefix, trackingType);
trackingType: null == trackingType
? _value.trackingType @override
: trackingType // ignore: cast_nullable_to_non_nullable String toString() {
as TrackingMediumType, return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)';
) as $Val);
} }
} }
/// @nodoc /// @nodoc
abstract class _$$DetailsStateImplCopyWith<$Res> abstract mixin class $DetailsStateCopyWith<$Res> {
implements $DetailsStateCopyWith<$Res> { factory $DetailsStateCopyWith(
factory _$$DetailsStateImplCopyWith( DetailsState value, $Res Function(DetailsState) _then) =
_$DetailsStateImpl value, $Res Function(_$DetailsStateImpl) then) = _$DetailsStateCopyWithImpl;
__$$DetailsStateImplCopyWithImpl<$Res>;
@override
@useResult @useResult
$Res call( $Res call(
{TrackingMedium? data, {TrackingMedium? data,
@@ -90,12 +61,11 @@ abstract class _$$DetailsStateImplCopyWith<$Res>
} }
/// @nodoc /// @nodoc
class __$$DetailsStateImplCopyWithImpl<$Res> class _$DetailsStateCopyWithImpl<$Res> implements $DetailsStateCopyWith<$Res> {
extends _$DetailsStateCopyWithImpl<$Res, _$DetailsStateImpl> _$DetailsStateCopyWithImpl(this._self, this._then);
implements _$$DetailsStateImplCopyWith<$Res> {
__$$DetailsStateImplCopyWithImpl( final DetailsState _self;
_$DetailsStateImpl _value, $Res Function(_$DetailsStateImpl) _then) final $Res Function(DetailsState) _then;
: super(_value, _then);
/// Create a copy of DetailsState /// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@@ -106,27 +76,190 @@ class __$$DetailsStateImplCopyWithImpl<$Res>
Object? heroImagePrefix = freezed, Object? heroImagePrefix = freezed,
Object? trackingType = null, Object? trackingType = null,
}) { }) {
return _then(_$DetailsStateImpl( return _then(_self.copyWith(
data: freezed == data data: freezed == data
? _value.data ? _self.data
: data // ignore: cast_nullable_to_non_nullable : data // ignore: cast_nullable_to_non_nullable
as TrackingMedium?, as TrackingMedium?,
heroImagePrefix: freezed == heroImagePrefix heroImagePrefix: freezed == heroImagePrefix
? _value.heroImagePrefix ? _self.heroImagePrefix
: heroImagePrefix // ignore: cast_nullable_to_non_nullable : heroImagePrefix // ignore: cast_nullable_to_non_nullable
as String?, as String?,
trackingType: null == trackingType trackingType: null == trackingType
? _value.trackingType ? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable : trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType, as TrackingMediumType,
)); ));
} }
} }
/// Adds pattern-matching-related methods to [DetailsState].
extension DetailsStatePatterns on DetailsState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_DetailsState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_DetailsState value) $default,
) {
final _that = this;
switch (_that) {
case _DetailsState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_DetailsState value)? $default,
) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(TrackingMedium? data, String? heroImagePrefix,
TrackingMediumType trackingType)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(TrackingMedium? data, String? heroImagePrefix,
TrackingMediumType trackingType)
$default,
) {
final _that = this;
switch (_that) {
case _DetailsState():
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(TrackingMedium? data, String? heroImagePrefix,
TrackingMediumType trackingType)?
$default,
) {
final _that = this;
switch (_that) {
case _DetailsState() when $default != null:
return $default(_that.data, _that.heroImagePrefix, _that.trackingType);
case _:
return null;
}
}
}
/// @nodoc /// @nodoc
class _$DetailsStateImpl implements _DetailsState { class _DetailsState implements DetailsState {
_$DetailsStateImpl( _DetailsState(
{this.data, {this.data,
this.heroImagePrefix, this.heroImagePrefix,
this.trackingType = TrackingMediumType.anime}); this.trackingType = TrackingMediumType.anime});
@@ -139,16 +272,19 @@ class _$DetailsStateImpl implements _DetailsState {
@JsonKey() @JsonKey()
final TrackingMediumType trackingType; final TrackingMediumType trackingType;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@override @override
String toString() { @JsonKey(includeFromJson: false, includeToJson: false)
return 'DetailsState(data: $data, heroImagePrefix: $heroImagePrefix, trackingType: $trackingType)'; @pragma('vm:prefer-inline')
} _$DetailsStateCopyWith<_DetailsState> get copyWith =>
__$DetailsStateCopyWithImpl<_DetailsState>(this, _$identity);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType &&
other is _$DetailsStateImpl && other is _DetailsState &&
(identical(other.data, data) || other.data == data) && (identical(other.data, data) || other.data == data) &&
(identical(other.heroImagePrefix, heroImagePrefix) || (identical(other.heroImagePrefix, heroImagePrefix) ||
other.heroImagePrefix == heroImagePrefix) && other.heroImagePrefix == heroImagePrefix) &&
@@ -160,32 +296,58 @@ class _$DetailsStateImpl implements _DetailsState {
int get hashCode => int get hashCode =>
Object.hash(runtimeType, data, heroImagePrefix, trackingType); 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});
}
/// @nodoc
class __$DetailsStateCopyWithImpl<$Res>
implements _$DetailsStateCopyWith<$Res> {
__$DetailsStateCopyWithImpl(this._self, this._then);
final _DetailsState _self;
final $Res Function(_DetailsState) _then;
/// Create a copy of DetailsState /// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override @override
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
_$$DetailsStateImplCopyWith<_$DetailsStateImpl> get copyWith => $Res call({
__$$DetailsStateImplCopyWithImpl<_$DetailsStateImpl>(this, _$identity); Object? data = freezed,
Object? heroImagePrefix = freezed,
Object? trackingType = null,
}) {
return _then(_DetailsState(
data: freezed == data
? _self.data
: data // ignore: cast_nullable_to_non_nullable
as TrackingMedium?,
heroImagePrefix: freezed == heroImagePrefix
? _self.heroImagePrefix
: heroImagePrefix // ignore: cast_nullable_to_non_nullable
as String?,
trackingType: null == trackingType
? _self.trackingType
: trackingType // ignore: cast_nullable_to_non_nullable
as TrackingMediumType,
));
}
} }
abstract class _DetailsState implements DetailsState { // dart format on
factory _DetailsState(
{final TrackingMedium? data,
final String? heroImagePrefix,
final TrackingMediumType trackingType}) = _$DetailsStateImpl;
@override
TrackingMedium? get data;
@override
String? get heroImagePrefix;
@override
TrackingMediumType get trackingType;
/// Create a copy of DetailsState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DetailsStateImplCopyWith<_$DetailsStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,7 +1,7 @@
part of 'details_bloc.dart'; part of 'details_bloc.dart';
@freezed @freezed
class DetailsState with _$DetailsState { abstract class DetailsState with _$DetailsState {
factory DetailsState({ factory DetailsState({
TrackingMedium? data, TrackingMedium? data,
String? heroImagePrefix, String? heroImagePrefix,

View File

@@ -75,8 +75,8 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
); );
_showLoadingSpinner(emit); _showLoadingSpinner(emit);
final inputStream = InputFileStream(event.path); final input = await File(event.path).readAsBytes();
final listRaw = GZipDecoder().decodeBuffer(inputStream); final listRaw = const GZipDecoder().decodeBytes(input);
final listXml = utf8.decode(listRaw); final listXml = utf8.decode(listRaw);
final document = XmlDocument.parse(listXml); final document = XmlDocument.parse(listXml);
final mal = document.getElement('myanimelist'); final mal = document.getElement('myanimelist');
@@ -148,8 +148,8 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
); );
_showLoadingSpinner(emit); _showLoadingSpinner(emit);
final inputStream = InputFileStream(event.path); final input = await File(event.path).readAsBytes();
final listRaw = GZipDecoder().decodeBuffer(inputStream); final listRaw = const archive.GZipDecoder().decodeBytes(input);
final listXml = utf8.decode(listRaw); final listXml = utf8.decode(listRaw);
final document = XmlDocument.parse(listXml); final document = XmlDocument.parse(listXml);
final mal = document.getElement('myanimelist'); final mal = document.getElement('myanimelist');
@@ -230,11 +230,9 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
event.path, event.path,
'anitrack_${date.year}${date.month}${date.day}.json.gz', 'anitrack_${date.year}${date.month}${date.day}.json.gz',
); );
archive.GZipEncoder().encode(
InputStream(utf8.encode(exportData)),
output: OutputFileStream(outputPath),
);
final output = const archive.GZipEncoder().encode(utf8.encode(exportData));
await File(outputPath).writeAsBytes(output);
await Fluttertoast.showToast( await Fluttertoast.showToast(
msg: t.settings.dataExportSuccess, msg: t.settings.dataExportSuccess,
); );

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint // ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
@@ -9,87 +9,62 @@ part of 'settings_bloc.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc /// @nodoc
mixin _$SettingsState { mixin _$SettingsState {
bool get importSpinnerVisible => throw _privateConstructorUsedError; bool get importSpinnerVisible;
int get importCurrent => throw _privateConstructorUsedError; int get importCurrent;
int get importTotal => throw _privateConstructorUsedError; int get importTotal;
/// Create a copy of SettingsState /// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
$SettingsStateCopyWith<SettingsState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SettingsStateCopyWith<$Res> {
factory $SettingsStateCopyWith(
SettingsState value, $Res Function(SettingsState) then) =
_$SettingsStateCopyWithImpl<$Res, SettingsState>;
@useResult
$Res call({bool importSpinnerVisible, int importCurrent, int importTotal});
}
/// @nodoc
class _$SettingsStateCopyWithImpl<$Res, $Val extends SettingsState>
implements $SettingsStateCopyWith<$Res> {
_$SettingsStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
$SettingsStateCopyWith<SettingsState> get copyWith =>
_$SettingsStateCopyWithImpl<SettingsState>(
this as SettingsState, _$identity);
@override @override
$Res call({ bool operator ==(Object other) {
Object? importSpinnerVisible = null, return identical(this, other) ||
Object? importCurrent = null, (other.runtimeType == runtimeType &&
Object? importTotal = null, other is SettingsState &&
}) { (identical(other.importSpinnerVisible, importSpinnerVisible) ||
return _then(_value.copyWith( other.importSpinnerVisible == importSpinnerVisible) &&
importSpinnerVisible: null == importSpinnerVisible (identical(other.importCurrent, importCurrent) ||
? _value.importSpinnerVisible other.importCurrent == importCurrent) &&
: importSpinnerVisible // ignore: cast_nullable_to_non_nullable (identical(other.importTotal, importTotal) ||
as bool, other.importTotal == importTotal));
importCurrent: null == importCurrent }
? _value.importCurrent
: importCurrent // ignore: cast_nullable_to_non_nullable @override
as int, int get hashCode => Object.hash(
importTotal: null == importTotal runtimeType, importSpinnerVisible, importCurrent, importTotal);
? _value.importTotal
: importTotal // ignore: cast_nullable_to_non_nullable @override
as int, String toString() {
) as $Val); return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)';
} }
} }
/// @nodoc /// @nodoc
abstract class _$$SettingsStateImplCopyWith<$Res> abstract mixin class $SettingsStateCopyWith<$Res> {
implements $SettingsStateCopyWith<$Res> { factory $SettingsStateCopyWith(
factory _$$SettingsStateImplCopyWith( SettingsState value, $Res Function(SettingsState) _then) =
_$SettingsStateImpl value, $Res Function(_$SettingsStateImpl) then) = _$SettingsStateCopyWithImpl;
__$$SettingsStateImplCopyWithImpl<$Res>;
@override
@useResult @useResult
$Res call({bool importSpinnerVisible, int importCurrent, int importTotal}); $Res call({bool importSpinnerVisible, int importCurrent, int importTotal});
} }
/// @nodoc /// @nodoc
class __$$SettingsStateImplCopyWithImpl<$Res> class _$SettingsStateCopyWithImpl<$Res>
extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateImpl> implements $SettingsStateCopyWith<$Res> {
implements _$$SettingsStateImplCopyWith<$Res> { _$SettingsStateCopyWithImpl(this._self, this._then);
__$$SettingsStateImplCopyWithImpl(
_$SettingsStateImpl _value, $Res Function(_$SettingsStateImpl) _then) final SettingsState _self;
: super(_value, _then); final $Res Function(SettingsState) _then;
/// Create a copy of SettingsState /// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@@ -100,27 +75,193 @@ class __$$SettingsStateImplCopyWithImpl<$Res>
Object? importCurrent = null, Object? importCurrent = null,
Object? importTotal = null, Object? importTotal = null,
}) { }) {
return _then(_$SettingsStateImpl( return _then(_self.copyWith(
importSpinnerVisible: null == importSpinnerVisible importSpinnerVisible: null == importSpinnerVisible
? _value.importSpinnerVisible ? _self.importSpinnerVisible
: importSpinnerVisible // ignore: cast_nullable_to_non_nullable : importSpinnerVisible // ignore: cast_nullable_to_non_nullable
as bool, as bool,
importCurrent: null == importCurrent importCurrent: null == importCurrent
? _value.importCurrent ? _self.importCurrent
: importCurrent // ignore: cast_nullable_to_non_nullable : importCurrent // ignore: cast_nullable_to_non_nullable
as int, as int,
importTotal: null == importTotal importTotal: null == importTotal
? _value.importTotal ? _self.importTotal
: importTotal // ignore: cast_nullable_to_non_nullable : importTotal // ignore: cast_nullable_to_non_nullable
as int, as int,
)); ));
} }
} }
/// Adds pattern-matching-related methods to [SettingsState].
extension SettingsStatePatterns on SettingsState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_SettingsState value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_SettingsState value) $default,
) {
final _that = this;
switch (_that) {
case _SettingsState():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_SettingsState value)? $default,
) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(
bool importSpinnerVisible, int importCurrent, int importTotal)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(
bool importSpinnerVisible, int importCurrent, int importTotal)
$default,
) {
final _that = this;
switch (_that) {
case _SettingsState():
return $default(
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
bool importSpinnerVisible, int importCurrent, int importTotal)?
$default,
) {
final _that = this;
switch (_that) {
case _SettingsState() when $default != null:
return $default(
_that.importSpinnerVisible, _that.importCurrent, _that.importTotal);
case _:
return null;
}
}
}
/// @nodoc /// @nodoc
class _$SettingsStateImpl implements _SettingsState { class _SettingsState implements SettingsState {
_$SettingsStateImpl( _SettingsState(
{this.importSpinnerVisible = false, {this.importSpinnerVisible = false,
this.importCurrent = 0, this.importCurrent = 0,
this.importTotal = 0}); this.importTotal = 0});
@@ -135,16 +276,19 @@ class _$SettingsStateImpl implements _SettingsState {
@JsonKey() @JsonKey()
final int importTotal; final int importTotal;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@override @override
String toString() { @JsonKey(includeFromJson: false, includeToJson: false)
return 'SettingsState(importSpinnerVisible: $importSpinnerVisible, importCurrent: $importCurrent, importTotal: $importTotal)'; @pragma('vm:prefer-inline')
} _$SettingsStateCopyWith<_SettingsState> get copyWith =>
__$SettingsStateCopyWithImpl<_SettingsState>(this, _$identity);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType &&
other is _$SettingsStateImpl && other is _SettingsState &&
(identical(other.importSpinnerVisible, importSpinnerVisible) || (identical(other.importSpinnerVisible, importSpinnerVisible) ||
other.importSpinnerVisible == importSpinnerVisible) && other.importSpinnerVisible == importSpinnerVisible) &&
(identical(other.importCurrent, importCurrent) || (identical(other.importCurrent, importCurrent) ||
@@ -157,32 +301,55 @@ class _$SettingsStateImpl implements _SettingsState {
int get hashCode => Object.hash( int get hashCode => Object.hash(
runtimeType, importSpinnerVisible, importCurrent, importTotal); 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});
}
/// @nodoc
class __$SettingsStateCopyWithImpl<$Res>
implements _$SettingsStateCopyWith<$Res> {
__$SettingsStateCopyWithImpl(this._self, this._then);
final _SettingsState _self;
final $Res Function(_SettingsState) _then;
/// Create a copy of SettingsState /// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override @override
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline')
_$$SettingsStateImplCopyWith<_$SettingsStateImpl> get copyWith => $Res call({
__$$SettingsStateImplCopyWithImpl<_$SettingsStateImpl>(this, _$identity); Object? importSpinnerVisible = null,
Object? importCurrent = null,
Object? importTotal = null,
}) {
return _then(_SettingsState(
importSpinnerVisible: null == importSpinnerVisible
? _self.importSpinnerVisible
: importSpinnerVisible // ignore: cast_nullable_to_non_nullable
as bool,
importCurrent: null == importCurrent
? _self.importCurrent
: importCurrent // ignore: cast_nullable_to_non_nullable
as int,
importTotal: null == importTotal
? _self.importTotal
: importTotal // ignore: cast_nullable_to_non_nullable
as int,
));
}
} }
abstract class _SettingsState implements SettingsState { // dart format on
factory _SettingsState(
{final bool importSpinnerVisible,
final int importCurrent,
final int importTotal}) = _$SettingsStateImpl;
@override
bool get importSpinnerVisible;
@override
int get importCurrent;
@override
int get importTotal;
/// Create a copy of SettingsState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SettingsStateImplCopyWith<_$SettingsStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,7 +1,7 @@
part of 'settings_bloc.dart'; part of 'settings_bloc.dart';
@freezed @freezed
class SettingsState with _$SettingsState { abstract class SettingsState with _$SettingsState {
factory SettingsState({ factory SettingsState({
@Default(false) bool importSpinnerVisible, @Default(false) bool importSpinnerVisible,
@Default(0) int importCurrent, @Default(0) int importCurrent,

File diff suppressed because it is too large Load Diff

View File

@@ -5,28 +5,28 @@ publish_to: "none"
version: 0.1.3+2011 version: 0.1.3+2011
environment: environment:
sdk: ">=3.0.0 <4.0.0" sdk: ^3.8.0
dependencies: dependencies:
archive: ^3.6.1 archive: ^4.0.9
bloc: ^8.1.4 bloc: ^9.2.0
bottom_bar: ^2.0.3 bottom_bar: ^2.0.3
cached_network_image: ^3.4.1 cached_network_image: ^3.4.1
collection: ^1.18.0 collection: ^1.18.0
cupertino_icons: ^1.0.8 cupertino_icons: ^1.0.8
file_picker: ^8.1.2 file_picker: ^10.3.10
flutter: flutter:
sdk: flutter sdk: flutter
flutter_bloc: ^8.1.6 flutter_bloc: ^9.1.1
fluttertoast: ^8.2.8 fluttertoast: ^9.0.0
freezed_annotation: ^2.4.4 freezed_annotation: ^3.1.0
get_it: ^8.0.0 get_it: ^9.2.1
jikan_api: ^2.2.1 jikan_api: ^2.2.1
json_annotation: ^4.9.0 json_annotation: ^4.11.0
path: ^1.9.0 path: ^1.9.0
permission_handler: ^11.3.1 permission_handler: ^12.0.1
slang: ^3.31.2 slang: ^4.13.0
slang_flutter: ^3.31.0 slang_flutter: ^4.13.0
sqflite: ^2.3.3+2 sqflite: ^2.3.3+2
sqflite_common_ffi: sqflite_common_ffi:
swipeable_tile: ^2.0.1 swipeable_tile: ^2.0.1
@@ -36,14 +36,14 @@ dependencies:
dev_dependencies: dev_dependencies:
build_runner: ^2.4.12 build_runner: ^2.4.12
flutter_launcher_icons: ^0.14.1 flutter_launcher_icons: ^0.14.1
flutter_lints: ^5.0.0 flutter_lints: ^6.0.0
flutter_oss_licenses: ^3.0.2 flutter_oss_licenses: ^3.0.2
flutter_test: flutter_test:
sdk: flutter sdk: flutter
freezed: ^2.5.7 freezed: ^3.2.5
json_serializable: ^6.8.0 json_serializable: ^6.8.0
slang_build_runner: ^3.31.0 slang_build_runner: ^4.13.0
very_good_analysis: ^6.0.0 very_good_analysis: ^10.2.0
flutter: flutter:
uses-material-design: true uses-material-design: true