update dependencies and bump version to 0.1.7+45
- Bump version to `0.1.7+45` and update SDK constraint to `>=3.8.0 <4.0.0`. - Update numerous dependencies
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'loadable_state_state.freezed.dart';
|
||||
|
||||
@freezed
|
||||
class LoadableStateState with _$LoadableStateState {
|
||||
abstract class LoadableStateState with _$LoadableStateState {
|
||||
const factory LoadableStateState({
|
||||
required List<ConnectivityResult>? connections,
|
||||
}) = _LoadableStateState;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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
|
||||
|
||||
@@ -9,150 +9,271 @@ part of 'loadable_state_state.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
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
|
||||
mixin _$LoadableStateState {
|
||||
List<ConnectivityResult>? get connections =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LoadableStateStateCopyWith<LoadableStateState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
List<ConnectivityResult>? get connections;
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadableStateStateCopyWith<LoadableStateState> get copyWith => _$LoadableStateStateCopyWithImpl<LoadableStateState>(this as LoadableStateState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableStateState&&const DeepCollectionEquality().equals(other.connections, connections));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(connections));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableStateState(connections: $connections)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LoadableStateStateCopyWith<$Res> {
|
||||
factory $LoadableStateStateCopyWith(
|
||||
LoadableStateState value, $Res Function(LoadableStateState) then) =
|
||||
_$LoadableStateStateCopyWithImpl<$Res, LoadableStateState>;
|
||||
@useResult
|
||||
$Res call({List<ConnectivityResult>? connections});
|
||||
}
|
||||
abstract mixin class $LoadableStateStateCopyWith<$Res> {
|
||||
factory $LoadableStateStateCopyWith(LoadableStateState value, $Res Function(LoadableStateState) _then) = _$LoadableStateStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<ConnectivityResult>? connections
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoadableStateStateCopyWithImpl<$Res, $Val extends LoadableStateState>
|
||||
class _$LoadableStateStateCopyWithImpl<$Res>
|
||||
implements $LoadableStateStateCopyWith<$Res> {
|
||||
_$LoadableStateStateCopyWithImpl(this._value, this._then);
|
||||
_$LoadableStateStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
final LoadableStateState _self;
|
||||
final $Res Function(LoadableStateState) _then;
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? connections = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
connections: freezed == connections
|
||||
? _value.connections
|
||||
: connections // ignore: cast_nullable_to_non_nullable
|
||||
as List<ConnectivityResult>?,
|
||||
) as $Val);
|
||||
}
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? connections = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
connections: freezed == connections ? _self.connections : connections // ignore: cast_nullable_to_non_nullable
|
||||
as List<ConnectivityResult>?,
|
||||
));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadableStateStateImplCopyWith<$Res>
|
||||
implements $LoadableStateStateCopyWith<$Res> {
|
||||
factory _$$LoadableStateStateImplCopyWith(_$LoadableStateStateImpl value,
|
||||
$Res Function(_$LoadableStateStateImpl) then) =
|
||||
__$$LoadableStateStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<ConnectivityResult>? connections});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadableStateStateImplCopyWithImpl<$Res>
|
||||
extends _$LoadableStateStateCopyWithImpl<$Res, _$LoadableStateStateImpl>
|
||||
implements _$$LoadableStateStateImplCopyWith<$Res> {
|
||||
__$$LoadableStateStateImplCopyWithImpl(_$LoadableStateStateImpl _value,
|
||||
$Res Function(_$LoadableStateStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? connections = freezed,
|
||||
}) {
|
||||
return _then(_$LoadableStateStateImpl(
|
||||
connections: freezed == connections
|
||||
? _value._connections
|
||||
: connections // ignore: cast_nullable_to_non_nullable
|
||||
as List<ConnectivityResult>?,
|
||||
));
|
||||
}
|
||||
/// Adds pattern-matching-related methods to [LoadableStateState].
|
||||
extension LoadableStateStatePatterns on LoadableStateState {
|
||||
/// 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( _LoadableStateState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() 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( _LoadableStateState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState():
|
||||
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( _LoadableStateState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() 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( List<ConnectivityResult>? connections)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() when $default != null:
|
||||
return $default(_that.connections);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( List<ConnectivityResult>? connections) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState():
|
||||
return $default(_that.connections);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( List<ConnectivityResult>? connections)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() when $default != null:
|
||||
return $default(_that.connections);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$LoadableStateStateImpl implements _LoadableStateState {
|
||||
const _$LoadableStateStateImpl(
|
||||
{required final List<ConnectivityResult>? connections})
|
||||
: _connections = connections;
|
||||
|
||||
final List<ConnectivityResult>? _connections;
|
||||
@override
|
||||
List<ConnectivityResult>? get connections {
|
||||
final value = _connections;
|
||||
if (value == null) return null;
|
||||
if (_connections is EqualUnmodifiableListView) return _connections;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
class _LoadableStateState implements LoadableStateState {
|
||||
const _LoadableStateState({required final List<ConnectivityResult>? connections}): _connections = connections;
|
||||
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableStateState(connections: $connections)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadableStateStateImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._connections, _connections));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_connections));
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadableStateStateImplCopyWith<_$LoadableStateStateImpl> get copyWith =>
|
||||
__$$LoadableStateStateImplCopyWithImpl<_$LoadableStateStateImpl>(
|
||||
this, _$identity);
|
||||
final List<ConnectivityResult>? _connections;
|
||||
@override List<ConnectivityResult>? get connections {
|
||||
final value = _connections;
|
||||
if (value == null) return null;
|
||||
if (_connections is EqualUnmodifiableListView) return _connections;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
abstract class _LoadableStateState implements LoadableStateState {
|
||||
const factory _LoadableStateState(
|
||||
{required final List<ConnectivityResult>? connections}) =
|
||||
_$LoadableStateStateImpl;
|
||||
|
||||
@override
|
||||
List<ConnectivityResult>? get connections;
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadableStateStateCopyWith<_LoadableStateState> get copyWith => __$LoadableStateStateCopyWithImpl<_LoadableStateState>(this, _$identity);
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadableStateStateImplCopyWith<_$LoadableStateStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableStateState&&const DeepCollectionEquality().equals(other._connections, _connections));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_connections));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableStateState(connections: $connections)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadableStateStateCopyWith<$Res> implements $LoadableStateStateCopyWith<$Res> {
|
||||
factory _$LoadableStateStateCopyWith(_LoadableStateState value, $Res Function(_LoadableStateState) _then) = __$LoadableStateStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<ConnectivityResult>? connections
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadableStateStateCopyWithImpl<$Res>
|
||||
implements _$LoadableStateStateCopyWith<$Res> {
|
||||
__$LoadableStateStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadableStateState _self;
|
||||
final $Res Function(_LoadableStateState) _then;
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? connections = freezed,}) {
|
||||
return _then(_LoadableStateState(
|
||||
connections: freezed == connections ? _self._connections : connections // ignore: cast_nullable_to_non_nullable
|
||||
as List<ConnectivityResult>?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'loading_error.dart';
|
||||
part 'loadable_state.freezed.dart';
|
||||
|
||||
@freezed
|
||||
class LoadableState<TState> with _$LoadableState {
|
||||
abstract class LoadableState<TState> with _$LoadableState<TState> {
|
||||
const LoadableState._();
|
||||
|
||||
const factory LoadableState({
|
||||
@@ -14,7 +14,7 @@ class LoadableState<TState> with _$LoadableState {
|
||||
required int? lastFetch,
|
||||
required void Function()? reFetch,
|
||||
required LoadingError? error,
|
||||
}) = _LoadableState;
|
||||
}) = _LoadableState<TState>;
|
||||
|
||||
bool _hasError() => error != null;
|
||||
bool _hasData() => data != null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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
|
||||
|
||||
@@ -9,246 +9,299 @@ part of 'loadable_state.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
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
|
||||
mixin _$LoadableState<TState> {
|
||||
bool get isLoading => throw _privateConstructorUsedError;
|
||||
TState? get data => throw _privateConstructorUsedError;
|
||||
int? get lastFetch => throw _privateConstructorUsedError;
|
||||
void Function()? get reFetch => throw _privateConstructorUsedError;
|
||||
LoadingError? get error => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
bool get isLoading; TState? get data; int? get lastFetch; void Function()? get reFetch; LoadingError? get error;
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith => _$LoadableStateCopyWithImpl<TState, LoadableState<TState>>(this as LoadableState<TState>, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableState<TState>&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.lastFetch, lastFetch) || other.lastFetch == lastFetch)&&(identical(other.reFetch, reFetch) || other.reFetch == reFetch)&&(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isLoading,const DeepCollectionEquality().hash(data),lastFetch,reFetch,error);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LoadableStateCopyWith<TState, $Res> {
|
||||
factory $LoadableStateCopyWith(LoadableState<TState> value,
|
||||
$Res Function(LoadableState<TState>) then) =
|
||||
_$LoadableStateCopyWithImpl<TState, $Res, LoadableState<TState>>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
TState? data,
|
||||
int? lastFetch,
|
||||
void Function()? reFetch,
|
||||
LoadingError? error});
|
||||
abstract mixin class $LoadableStateCopyWith<TState,$Res> {
|
||||
factory $LoadableStateCopyWith(LoadableState<TState> value, $Res Function(LoadableState<TState>) _then) = _$LoadableStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error
|
||||
});
|
||||
|
||||
|
||||
$LoadingErrorCopyWith<$Res>? get error;
|
||||
|
||||
$LoadingErrorCopyWith<$Res>? get error;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$LoadableStateCopyWithImpl<TState, $Res,
|
||||
$Val extends LoadableState<TState>>
|
||||
class _$LoadableStateCopyWithImpl<TState,$Res>
|
||||
implements $LoadableStateCopyWith<TState, $Res> {
|
||||
_$LoadableStateCopyWithImpl(this._value, this._then);
|
||||
_$LoadableStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
final LoadableState<TState> _self;
|
||||
final $Res Function(LoadableState<TState>) _then;
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? data = freezed,
|
||||
Object? lastFetch = freezed,
|
||||
Object? reFetch = freezed,
|
||||
Object? error = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,
|
||||
lastFetch: freezed == lastFetch
|
||||
? _value.lastFetch
|
||||
: lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
reFetch: freezed == reFetch
|
||||
? _value.reFetch
|
||||
: reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as LoadingError?,
|
||||
) as $Val);
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? data = freezed,Object? lastFetch = freezed,Object? reFetch = freezed,Object? error = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,lastFetch: freezed == lastFetch ? _self.lastFetch : lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,reFetch: freezed == reFetch ? _self.reFetch : reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as LoadingError?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadingErrorCopyWith<$Res>? get error {
|
||||
if (_self.error == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadingErrorCopyWith<$Res>? get error {
|
||||
if (_value.error == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $LoadingErrorCopyWith<$Res>(_value.error!, (value) {
|
||||
return _then(_value.copyWith(error: value) as $Val);
|
||||
});
|
||||
}
|
||||
return $LoadingErrorCopyWith<$Res>(_self.error!, (value) {
|
||||
return _then(_self.copyWith(error: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadableStateImplCopyWith<TState, $Res>
|
||||
implements $LoadableStateCopyWith<TState, $Res> {
|
||||
factory _$$LoadableStateImplCopyWith(_$LoadableStateImpl<TState> value,
|
||||
$Res Function(_$LoadableStateImpl<TState>) then) =
|
||||
__$$LoadableStateImplCopyWithImpl<TState, $Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
TState? data,
|
||||
int? lastFetch,
|
||||
void Function()? reFetch,
|
||||
LoadingError? error});
|
||||
|
||||
@override
|
||||
$LoadingErrorCopyWith<$Res>? get error;
|
||||
/// Adds pattern-matching-related methods to [LoadableState].
|
||||
extension LoadableStatePatterns<TState> on LoadableState<TState> {
|
||||
/// 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( _LoadableState<TState> value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() 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( _LoadableState<TState> value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState():
|
||||
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( _LoadableState<TState> value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() 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 isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() when $default != null:
|
||||
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);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 isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState():
|
||||
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);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 isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() when $default != null:
|
||||
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadableStateImplCopyWithImpl<TState, $Res>
|
||||
extends _$LoadableStateCopyWithImpl<TState, $Res,
|
||||
_$LoadableStateImpl<TState>>
|
||||
implements _$$LoadableStateImplCopyWith<TState, $Res> {
|
||||
__$$LoadableStateImplCopyWithImpl(_$LoadableStateImpl<TState> _value,
|
||||
$Res Function(_$LoadableStateImpl<TState>) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? data = freezed,
|
||||
Object? lastFetch = freezed,
|
||||
Object? reFetch = freezed,
|
||||
Object? error = freezed,
|
||||
}) {
|
||||
return _then(_$LoadableStateImpl<TState>(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,
|
||||
lastFetch: freezed == lastFetch
|
||||
? _value.lastFetch
|
||||
: lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
reFetch: freezed == reFetch
|
||||
? _value.reFetch
|
||||
: reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as LoadingError?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$LoadableStateImpl<TState> extends _LoadableState<TState> {
|
||||
const _$LoadableStateImpl(
|
||||
{required this.isLoading,
|
||||
required this.data,
|
||||
required this.lastFetch,
|
||||
required this.reFetch,
|
||||
required this.error})
|
||||
: super._();
|
||||
|
||||
@override
|
||||
final bool isLoading;
|
||||
@override
|
||||
final TState? data;
|
||||
@override
|
||||
final int? lastFetch;
|
||||
@override
|
||||
final void Function()? reFetch;
|
||||
@override
|
||||
final LoadingError? error;
|
||||
class _LoadableState<TState> extends LoadableState<TState> {
|
||||
const _LoadableState({required this.isLoading, required this.data, required this.lastFetch, required this.reFetch, required this.error}): super._();
|
||||
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
|
||||
}
|
||||
@override final bool isLoading;
|
||||
@override final TState? data;
|
||||
@override final int? lastFetch;
|
||||
@override final void Function()? reFetch;
|
||||
@override final LoadingError? error;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadableStateImpl<TState> &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading) &&
|
||||
const DeepCollectionEquality().equals(other.data, data) &&
|
||||
(identical(other.lastFetch, lastFetch) ||
|
||||
other.lastFetch == lastFetch) &&
|
||||
(identical(other.reFetch, reFetch) || other.reFetch == reFetch) &&
|
||||
(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadableStateCopyWith<TState, _LoadableState<TState>> get copyWith => __$LoadableStateCopyWithImpl<TState, _LoadableState<TState>>(this, _$identity);
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, isLoading,
|
||||
const DeepCollectionEquality().hash(data), lastFetch, reFetch, error);
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
|
||||
get copyWith => __$$LoadableStateImplCopyWithImpl<TState,
|
||||
_$LoadableStateImpl<TState>>(this, _$identity);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableState<TState>&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.lastFetch, lastFetch) || other.lastFetch == lastFetch)&&(identical(other.reFetch, reFetch) || other.reFetch == reFetch)&&(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
abstract class _LoadableState<TState> extends LoadableState<TState> {
|
||||
const factory _LoadableState(
|
||||
{required final bool isLoading,
|
||||
required final TState? data,
|
||||
required final int? lastFetch,
|
||||
required final void Function()? reFetch,
|
||||
required final LoadingError? error}) = _$LoadableStateImpl<TState>;
|
||||
const _LoadableState._() : super._();
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
@override
|
||||
TState? get data;
|
||||
@override
|
||||
int? get lastFetch;
|
||||
@override
|
||||
void Function()? get reFetch;
|
||||
@override
|
||||
LoadingError? get error;
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isLoading,const DeepCollectionEquality().hash(data),lastFetch,reFetch,error);
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadableStateCopyWith<TState,$Res> implements $LoadableStateCopyWith<TState, $Res> {
|
||||
factory _$LoadableStateCopyWith(_LoadableState<TState> value, $Res Function(_LoadableState<TState>) _then) = __$LoadableStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error
|
||||
});
|
||||
|
||||
|
||||
@override $LoadingErrorCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadableStateCopyWithImpl<TState,$Res>
|
||||
implements _$LoadableStateCopyWith<TState, $Res> {
|
||||
__$LoadableStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadableState<TState> _self;
|
||||
final $Res Function(_LoadableState<TState>) _then;
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? data = freezed,Object? lastFetch = freezed,Object? reFetch = freezed,Object? error = freezed,}) {
|
||||
return _then(_LoadableState<TState>(
|
||||
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,lastFetch: freezed == lastFetch ? _self.lastFetch : lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,reFetch: freezed == reFetch ? _self.reFetch : reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as LoadingError?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadingErrorCopyWith<$Res>? get error {
|
||||
if (_self.error == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $LoadingErrorCopyWith<$Res>(_self.error!, (value) {
|
||||
return _then(_self.copyWith(error: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'loading_error.freezed.dart';
|
||||
|
||||
@freezed
|
||||
class LoadingError with _$LoadingError {
|
||||
abstract class LoadingError with _$LoadingError {
|
||||
const factory LoadingError({
|
||||
required String message,
|
||||
@Default(false) bool allowRetry,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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
|
||||
|
||||
@@ -9,155 +9,266 @@ part of 'loading_error.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
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
|
||||
mixin _$LoadingError {
|
||||
String get message => throw _privateConstructorUsedError;
|
||||
bool get allowRetry => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LoadingErrorCopyWith<LoadingError> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
String get message; bool get allowRetry;
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadingErrorCopyWith<LoadingError> get copyWith => _$LoadingErrorCopyWithImpl<LoadingError>(this as LoadingError, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadingError&&(identical(other.message, message) || other.message == message)&&(identical(other.allowRetry, allowRetry) || other.allowRetry == allowRetry));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,message,allowRetry);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LoadingErrorCopyWith<$Res> {
|
||||
factory $LoadingErrorCopyWith(
|
||||
LoadingError value, $Res Function(LoadingError) then) =
|
||||
_$LoadingErrorCopyWithImpl<$Res, LoadingError>;
|
||||
@useResult
|
||||
$Res call({String message, bool allowRetry});
|
||||
}
|
||||
abstract mixin class $LoadingErrorCopyWith<$Res> {
|
||||
factory $LoadingErrorCopyWith(LoadingError value, $Res Function(LoadingError) _then) = _$LoadingErrorCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String message, bool allowRetry
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoadingErrorCopyWithImpl<$Res, $Val extends LoadingError>
|
||||
class _$LoadingErrorCopyWithImpl<$Res>
|
||||
implements $LoadingErrorCopyWith<$Res> {
|
||||
_$LoadingErrorCopyWithImpl(this._value, this._then);
|
||||
_$LoadingErrorCopyWithImpl(this._self, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
final LoadingError _self;
|
||||
final $Res Function(LoadingError) _then;
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
Object? allowRetry = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
allowRetry: null == allowRetry
|
||||
? _value.allowRetry
|
||||
: allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? message = null,Object? allowRetry = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String,allowRetry: null == allowRetry ? _self.allowRetry : allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadingErrorImplCopyWith<$Res>
|
||||
implements $LoadingErrorCopyWith<$Res> {
|
||||
factory _$$LoadingErrorImplCopyWith(
|
||||
_$LoadingErrorImpl value, $Res Function(_$LoadingErrorImpl) then) =
|
||||
__$$LoadingErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String message, bool allowRetry});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadingErrorImplCopyWithImpl<$Res>
|
||||
extends _$LoadingErrorCopyWithImpl<$Res, _$LoadingErrorImpl>
|
||||
implements _$$LoadingErrorImplCopyWith<$Res> {
|
||||
__$$LoadingErrorImplCopyWithImpl(
|
||||
_$LoadingErrorImpl _value, $Res Function(_$LoadingErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
Object? allowRetry = null,
|
||||
}) {
|
||||
return _then(_$LoadingErrorImpl(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
allowRetry: null == allowRetry
|
||||
? _value.allowRetry
|
||||
: allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
/// Adds pattern-matching-related methods to [LoadingError].
|
||||
extension LoadingErrorPatterns on LoadingError {
|
||||
/// 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( _LoadingError value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() 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( _LoadingError value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError():
|
||||
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( _LoadingError value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() 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 message, bool allowRetry)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() when $default != null:
|
||||
return $default(_that.message,_that.allowRetry);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 message, bool allowRetry) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError():
|
||||
return $default(_that.message,_that.allowRetry);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 message, bool allowRetry)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() when $default != null:
|
||||
return $default(_that.message,_that.allowRetry);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$LoadingErrorImpl implements _LoadingError {
|
||||
const _$LoadingErrorImpl({required this.message, this.allowRetry = false});
|
||||
|
||||
@override
|
||||
final String message;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool allowRetry;
|
||||
class _LoadingError implements LoadingError {
|
||||
const _LoadingError({required this.message, this.allowRetry = false});
|
||||
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
|
||||
}
|
||||
@override final String message;
|
||||
@override@JsonKey() final bool allowRetry;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadingErrorImpl &&
|
||||
(identical(other.message, message) || other.message == message) &&
|
||||
(identical(other.allowRetry, allowRetry) ||
|
||||
other.allowRetry == allowRetry));
|
||||
}
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadingErrorCopyWith<_LoadingError> get copyWith => __$LoadingErrorCopyWithImpl<_LoadingError>(this, _$identity);
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, message, allowRetry);
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadingErrorImplCopyWith<_$LoadingErrorImpl> get copyWith =>
|
||||
__$$LoadingErrorImplCopyWithImpl<_$LoadingErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadingError&&(identical(other.message, message) || other.message == message)&&(identical(other.allowRetry, allowRetry) || other.allowRetry == allowRetry));
|
||||
}
|
||||
|
||||
abstract class _LoadingError implements LoadingError {
|
||||
const factory _LoadingError(
|
||||
{required final String message,
|
||||
final bool allowRetry}) = _$LoadingErrorImpl;
|
||||
|
||||
@override
|
||||
String get message;
|
||||
@override
|
||||
bool get allowRetry;
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,message,allowRetry);
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadingErrorImplCopyWith<_$LoadingErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadingErrorCopyWith<$Res> implements $LoadingErrorCopyWith<$Res> {
|
||||
factory _$LoadingErrorCopyWith(_LoadingError value, $Res Function(_LoadingError) _then) = __$LoadingErrorCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String message, bool allowRetry
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadingErrorCopyWithImpl<$Res>
|
||||
implements _$LoadingErrorCopyWith<$Res> {
|
||||
__$LoadingErrorCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadingError _self;
|
||||
final $Res Function(_LoadingError) _then;
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? message = null,Object? allowRetry = null,}) {
|
||||
return _then(_LoadingError(
|
||||
message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String,allowRetry: null == allowRetry ? _self.allowRetry : allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -26,7 +26,7 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
|
||||
var loadableState = context.watch<TController>().state;
|
||||
|
||||
if(!loadableState.isLoading && onLoad != null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data));
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data!));
|
||||
}
|
||||
|
||||
var childWidget = ConditionalWrapper(
|
||||
@@ -48,7 +48,7 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
|
||||
child: SizedBox(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: loadableState.showContent()
|
||||
? child(loadableState.data, loadableState.isLoading)
|
||||
? child(loadableState.data!, loadableState.isLoading)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -103,7 +103,7 @@ abstract class LoadableHydratedBloc<
|
||||
Map<String, dynamic>? toJson(LoadableState<TState> state) {
|
||||
Map<String, dynamic>? data;
|
||||
try {
|
||||
data = state.data == null ? null : toStorage(state.data);
|
||||
data = state.data == null ? null : toStorage(state.data!);
|
||||
} catch(e) {
|
||||
log('Failed to save state ${TState.toString()}: ${e.toString()}');
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ part 'loadable_save_context.freezed.dart';
|
||||
part 'loadable_save_context.g.dart';
|
||||
|
||||
@freezed
|
||||
class LoadableSaveContext with _$LoadableSaveContext {
|
||||
abstract class LoadableSaveContext with _$LoadableSaveContext {
|
||||
const LoadableSaveContext._();
|
||||
const factory LoadableSaveContext({
|
||||
required int timestamp,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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
|
||||
|
||||
@@ -9,160 +9,269 @@ part of 'loadable_save_context.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
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');
|
||||
|
||||
LoadableSaveContext _$LoadableSaveContextFromJson(Map<String, dynamic> json) {
|
||||
return _LoadableSaveContext.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LoadableSaveContext {
|
||||
int get timestamp => throw _privateConstructorUsedError;
|
||||
|
||||
int get timestamp;
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith => _$LoadableSaveContextCopyWithImpl<LoadableSaveContext>(this as LoadableSaveContext, _$identity);
|
||||
|
||||
/// Serializes this LoadableSaveContext to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableSaveContext&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,timestamp);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableSaveContext(timestamp: $timestamp)';
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LoadableSaveContextCopyWith<$Res> {
|
||||
factory $LoadableSaveContextCopyWith(
|
||||
LoadableSaveContext value, $Res Function(LoadableSaveContext) then) =
|
||||
_$LoadableSaveContextCopyWithImpl<$Res, LoadableSaveContext>;
|
||||
@useResult
|
||||
$Res call({int timestamp});
|
||||
}
|
||||
abstract mixin class $LoadableSaveContextCopyWith<$Res> {
|
||||
factory $LoadableSaveContextCopyWith(LoadableSaveContext value, $Res Function(LoadableSaveContext) _then) = _$LoadableSaveContextCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int timestamp
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoadableSaveContextCopyWithImpl<$Res, $Val extends LoadableSaveContext>
|
||||
class _$LoadableSaveContextCopyWithImpl<$Res>
|
||||
implements $LoadableSaveContextCopyWith<$Res> {
|
||||
_$LoadableSaveContextCopyWithImpl(this._value, this._then);
|
||||
_$LoadableSaveContextCopyWithImpl(this._self, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
final LoadableSaveContext _self;
|
||||
final $Res Function(LoadableSaveContext) _then;
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? timestamp = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
timestamp: null == timestamp
|
||||
? _value.timestamp
|
||||
: timestamp // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? timestamp = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadableSaveContextImplCopyWith<$Res>
|
||||
implements $LoadableSaveContextCopyWith<$Res> {
|
||||
factory _$$LoadableSaveContextImplCopyWith(_$LoadableSaveContextImpl value,
|
||||
$Res Function(_$LoadableSaveContextImpl) then) =
|
||||
__$$LoadableSaveContextImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int timestamp});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadableSaveContextImplCopyWithImpl<$Res>
|
||||
extends _$LoadableSaveContextCopyWithImpl<$Res, _$LoadableSaveContextImpl>
|
||||
implements _$$LoadableSaveContextImplCopyWith<$Res> {
|
||||
__$$LoadableSaveContextImplCopyWithImpl(_$LoadableSaveContextImpl _value,
|
||||
$Res Function(_$LoadableSaveContextImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? timestamp = null,
|
||||
}) {
|
||||
return _then(_$LoadableSaveContextImpl(
|
||||
timestamp: null == timestamp
|
||||
? _value.timestamp
|
||||
: timestamp // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
/// Adds pattern-matching-related methods to [LoadableSaveContext].
|
||||
extension LoadableSaveContextPatterns on LoadableSaveContext {
|
||||
/// 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( _LoadableSaveContext value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() 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( _LoadableSaveContext value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext():
|
||||
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( _LoadableSaveContext value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() 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( int timestamp)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() when $default != null:
|
||||
return $default(_that.timestamp);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( int timestamp) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext():
|
||||
return $default(_that.timestamp);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( int timestamp)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() when $default != null:
|
||||
return $default(_that.timestamp);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$LoadableSaveContextImpl extends _LoadableSaveContext {
|
||||
const _$LoadableSaveContextImpl({required this.timestamp}) : super._();
|
||||
|
||||
factory _$LoadableSaveContextImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LoadableSaveContextImplFromJson(json);
|
||||
class _LoadableSaveContext extends LoadableSaveContext {
|
||||
const _LoadableSaveContext({required this.timestamp}): super._();
|
||||
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) => _$LoadableSaveContextFromJson(json);
|
||||
|
||||
@override
|
||||
final int timestamp;
|
||||
@override final int timestamp;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableSaveContext(timestamp: $timestamp)';
|
||||
}
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadableSaveContextCopyWith<_LoadableSaveContext> get copyWith => __$LoadableSaveContextCopyWithImpl<_LoadableSaveContext>(this, _$identity);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadableSaveContextImpl &&
|
||||
(identical(other.timestamp, timestamp) ||
|
||||
other.timestamp == timestamp));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, timestamp);
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadableSaveContextImplCopyWith<_$LoadableSaveContextImpl> get copyWith =>
|
||||
__$$LoadableSaveContextImplCopyWithImpl<_$LoadableSaveContextImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$LoadableSaveContextImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$LoadableSaveContextToJson(this, );
|
||||
}
|
||||
|
||||
abstract class _LoadableSaveContext extends LoadableSaveContext {
|
||||
const factory _LoadableSaveContext({required final int timestamp}) =
|
||||
_$LoadableSaveContextImpl;
|
||||
const _LoadableSaveContext._() : super._();
|
||||
|
||||
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) =
|
||||
_$LoadableSaveContextImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get timestamp;
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadableSaveContextImplCopyWith<_$LoadableSaveContextImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableSaveContext&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,timestamp);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableSaveContext(timestamp: $timestamp)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadableSaveContextCopyWith<$Res> implements $LoadableSaveContextCopyWith<$Res> {
|
||||
factory _$LoadableSaveContextCopyWith(_LoadableSaveContext value, $Res Function(_LoadableSaveContext) _then) = __$LoadableSaveContextCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int timestamp
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadableSaveContextCopyWithImpl<$Res>
|
||||
implements _$LoadableSaveContextCopyWith<$Res> {
|
||||
__$LoadableSaveContextCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadableSaveContext _self;
|
||||
final $Res Function(_LoadableSaveContext) _then;
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? timestamp = null,}) {
|
||||
return _then(_LoadableSaveContext(
|
||||
timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -6,14 +6,9 @@ part of 'loadable_save_context.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$LoadableSaveContextImpl _$$LoadableSaveContextImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$LoadableSaveContextImpl(
|
||||
timestamp: (json['timestamp'] as num).toInt(),
|
||||
);
|
||||
_LoadableSaveContext _$LoadableSaveContextFromJson(Map<String, dynamic> json) =>
|
||||
_LoadableSaveContext(timestamp: (json['timestamp'] as num).toInt());
|
||||
|
||||
Map<String, dynamic> _$$LoadableSaveContextImplToJson(
|
||||
_$LoadableSaveContextImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'timestamp': instance.timestamp,
|
||||
};
|
||||
Map<String, dynamic> _$LoadableSaveContextToJson(
|
||||
_LoadableSaveContext instance,
|
||||
) => <String, dynamic>{'timestamp': instance.timestamp};
|
||||
|
||||
@@ -4,7 +4,7 @@ part 'grade_averages_state.freezed.dart';
|
||||
part 'grade_averages_state.g.dart';
|
||||
|
||||
@freezed
|
||||
class GradeAveragesState with _$GradeAveragesState {
|
||||
abstract class GradeAveragesState with _$GradeAveragesState {
|
||||
const factory GradeAveragesState({
|
||||
required GradeAveragesGradingSystem gradingSystem,
|
||||
required List<int> grades,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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
|
||||
|
||||
@@ -9,185 +9,278 @@ part of 'grade_averages_state.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
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');
|
||||
|
||||
GradeAveragesState _$GradeAveragesStateFromJson(Map<String, dynamic> json) {
|
||||
return _GradeAveragesState.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$GradeAveragesState {
|
||||
GradeAveragesGradingSystem get gradingSystem =>
|
||||
throw _privateConstructorUsedError;
|
||||
List<int> get grades => throw _privateConstructorUsedError;
|
||||
|
||||
GradeAveragesGradingSystem get gradingSystem; List<int> get grades;
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$GradeAveragesStateCopyWith<GradeAveragesState> get copyWith => _$GradeAveragesStateCopyWithImpl<GradeAveragesState>(this as GradeAveragesState, _$identity);
|
||||
|
||||
/// Serializes this GradeAveragesState to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GradeAveragesState&&(identical(other.gradingSystem, gradingSystem) || other.gradingSystem == gradingSystem)&&const DeepCollectionEquality().equals(other.grades, grades));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,gradingSystem,const DeepCollectionEquality().hash(grades));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$GradeAveragesStateCopyWith<GradeAveragesState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $GradeAveragesStateCopyWith<$Res> {
|
||||
factory $GradeAveragesStateCopyWith(
|
||||
GradeAveragesState value, $Res Function(GradeAveragesState) then) =
|
||||
_$GradeAveragesStateCopyWithImpl<$Res, GradeAveragesState>;
|
||||
@useResult
|
||||
$Res call({GradeAveragesGradingSystem gradingSystem, List<int> grades});
|
||||
}
|
||||
abstract mixin class $GradeAveragesStateCopyWith<$Res> {
|
||||
factory $GradeAveragesStateCopyWith(GradeAveragesState value, $Res Function(GradeAveragesState) _then) = _$GradeAveragesStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
GradeAveragesGradingSystem gradingSystem, List<int> grades
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$GradeAveragesStateCopyWithImpl<$Res, $Val extends GradeAveragesState>
|
||||
class _$GradeAveragesStateCopyWithImpl<$Res>
|
||||
implements $GradeAveragesStateCopyWith<$Res> {
|
||||
_$GradeAveragesStateCopyWithImpl(this._value, this._then);
|
||||
_$GradeAveragesStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
final GradeAveragesState _self;
|
||||
final $Res Function(GradeAveragesState) _then;
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? gradingSystem = null,
|
||||
Object? grades = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
gradingSystem: null == gradingSystem
|
||||
? _value.gradingSystem
|
||||
: gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,
|
||||
grades: null == grades
|
||||
? _value.grades
|
||||
: grades // ignore: cast_nullable_to_non_nullable
|
||||
as List<int>,
|
||||
) as $Val);
|
||||
}
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? gradingSystem = null,Object? grades = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
gradingSystem: null == gradingSystem ? _self.gradingSystem : gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,grades: null == grades ? _self.grades : grades // ignore: cast_nullable_to_non_nullable
|
||||
as List<int>,
|
||||
));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$GradeAveragesStateImplCopyWith<$Res>
|
||||
implements $GradeAveragesStateCopyWith<$Res> {
|
||||
factory _$$GradeAveragesStateImplCopyWith(_$GradeAveragesStateImpl value,
|
||||
$Res Function(_$GradeAveragesStateImpl) then) =
|
||||
__$$GradeAveragesStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({GradeAveragesGradingSystem gradingSystem, List<int> grades});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$GradeAveragesStateImplCopyWithImpl<$Res>
|
||||
extends _$GradeAveragesStateCopyWithImpl<$Res, _$GradeAveragesStateImpl>
|
||||
implements _$$GradeAveragesStateImplCopyWith<$Res> {
|
||||
__$$GradeAveragesStateImplCopyWithImpl(_$GradeAveragesStateImpl _value,
|
||||
$Res Function(_$GradeAveragesStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? gradingSystem = null,
|
||||
Object? grades = null,
|
||||
}) {
|
||||
return _then(_$GradeAveragesStateImpl(
|
||||
gradingSystem: null == gradingSystem
|
||||
? _value.gradingSystem
|
||||
: gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,
|
||||
grades: null == grades
|
||||
? _value._grades
|
||||
: grades // ignore: cast_nullable_to_non_nullable
|
||||
as List<int>,
|
||||
));
|
||||
}
|
||||
/// Adds pattern-matching-related methods to [GradeAveragesState].
|
||||
extension GradeAveragesStatePatterns on GradeAveragesState {
|
||||
/// 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( _GradeAveragesState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() 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( _GradeAveragesState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState():
|
||||
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( _GradeAveragesState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() 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( GradeAveragesGradingSystem gradingSystem, List<int> grades)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() when $default != null:
|
||||
return $default(_that.gradingSystem,_that.grades);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( GradeAveragesGradingSystem gradingSystem, List<int> grades) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState():
|
||||
return $default(_that.gradingSystem,_that.grades);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( GradeAveragesGradingSystem gradingSystem, List<int> grades)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() when $default != null:
|
||||
return $default(_that.gradingSystem,_that.grades);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$GradeAveragesStateImpl implements _GradeAveragesState {
|
||||
const _$GradeAveragesStateImpl(
|
||||
{required this.gradingSystem, required final List<int> grades})
|
||||
: _grades = grades;
|
||||
|
||||
factory _$GradeAveragesStateImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$GradeAveragesStateImplFromJson(json);
|
||||
class _GradeAveragesState implements GradeAveragesState {
|
||||
const _GradeAveragesState({required this.gradingSystem, required final List<int> grades}): _grades = grades;
|
||||
factory _GradeAveragesState.fromJson(Map<String, dynamic> json) => _$GradeAveragesStateFromJson(json);
|
||||
|
||||
@override
|
||||
final GradeAveragesGradingSystem gradingSystem;
|
||||
final List<int> _grades;
|
||||
@override
|
||||
List<int> get grades {
|
||||
if (_grades is EqualUnmodifiableListView) return _grades;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_grades);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$GradeAveragesStateImpl &&
|
||||
(identical(other.gradingSystem, gradingSystem) ||
|
||||
other.gradingSystem == gradingSystem) &&
|
||||
const DeepCollectionEquality().equals(other._grades, _grades));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, gradingSystem, const DeepCollectionEquality().hash(_grades));
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$GradeAveragesStateImplCopyWith<_$GradeAveragesStateImpl> get copyWith =>
|
||||
__$$GradeAveragesStateImplCopyWithImpl<_$GradeAveragesStateImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$GradeAveragesStateImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
@override final GradeAveragesGradingSystem gradingSystem;
|
||||
final List<int> _grades;
|
||||
@override List<int> get grades {
|
||||
if (_grades is EqualUnmodifiableListView) return _grades;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_grades);
|
||||
}
|
||||
|
||||
abstract class _GradeAveragesState implements GradeAveragesState {
|
||||
const factory _GradeAveragesState(
|
||||
{required final GradeAveragesGradingSystem gradingSystem,
|
||||
required final List<int> grades}) = _$GradeAveragesStateImpl;
|
||||
|
||||
factory _GradeAveragesState.fromJson(Map<String, dynamic> json) =
|
||||
_$GradeAveragesStateImpl.fromJson;
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$GradeAveragesStateCopyWith<_GradeAveragesState> get copyWith => __$GradeAveragesStateCopyWithImpl<_GradeAveragesState>(this, _$identity);
|
||||
|
||||
@override
|
||||
GradeAveragesGradingSystem get gradingSystem;
|
||||
@override
|
||||
List<int> get grades;
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$GradeAveragesStateImplCopyWith<_$GradeAveragesStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$GradeAveragesStateToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GradeAveragesState&&(identical(other.gradingSystem, gradingSystem) || other.gradingSystem == gradingSystem)&&const DeepCollectionEquality().equals(other._grades, _grades));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,gradingSystem,const DeepCollectionEquality().hash(_grades));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$GradeAveragesStateCopyWith<$Res> implements $GradeAveragesStateCopyWith<$Res> {
|
||||
factory _$GradeAveragesStateCopyWith(_GradeAveragesState value, $Res Function(_GradeAveragesState) _then) = __$GradeAveragesStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
GradeAveragesGradingSystem gradingSystem, List<int> grades
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$GradeAveragesStateCopyWithImpl<$Res>
|
||||
implements _$GradeAveragesStateCopyWith<$Res> {
|
||||
__$GradeAveragesStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _GradeAveragesState _self;
|
||||
final $Res Function(_GradeAveragesState) _then;
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? gradingSystem = null,Object? grades = null,}) {
|
||||
return _then(_GradeAveragesState(
|
||||
gradingSystem: null == gradingSystem ? _self.gradingSystem : gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,grades: null == grades ? _self._grades : grades // ignore: cast_nullable_to_non_nullable
|
||||
as List<int>,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -6,23 +6,23 @@ part of 'grade_averages_state.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$GradeAveragesStateImpl _$$GradeAveragesStateImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$GradeAveragesStateImpl(
|
||||
_GradeAveragesState _$GradeAveragesStateFromJson(Map<String, dynamic> json) =>
|
||||
_GradeAveragesState(
|
||||
gradingSystem: $enumDecode(
|
||||
_$GradeAveragesGradingSystemEnumMap, json['gradingSystem']),
|
||||
_$GradeAveragesGradingSystemEnumMap,
|
||||
json['gradingSystem'],
|
||||
),
|
||||
grades: (json['grades'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$GradeAveragesStateImplToJson(
|
||||
_$GradeAveragesStateImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'gradingSystem':
|
||||
_$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!,
|
||||
'grades': instance.grades,
|
||||
};
|
||||
Map<String, dynamic> _$GradeAveragesStateToJson(
|
||||
_GradeAveragesState instance,
|
||||
) => <String, dynamic>{
|
||||
'gradingSystem': _$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!,
|
||||
'grades': instance.grades,
|
||||
};
|
||||
|
||||
const _$GradeAveragesGradingSystemEnumMap = {
|
||||
GradeAveragesGradingSystem.highSchool: 'highSchool',
|
||||
|
||||
@@ -5,7 +5,7 @@ part 'holidays_state.freezed.dart';
|
||||
part 'holidays_state.g.dart';
|
||||
|
||||
@freezed
|
||||
class HolidaysState with _$HolidaysState {
|
||||
abstract class HolidaysState with _$HolidaysState {
|
||||
const factory HolidaysState({
|
||||
required bool showPastHolidays,
|
||||
required bool showDisclaimer,
|
||||
@@ -16,7 +16,7 @@ class HolidaysState with _$HolidaysState {
|
||||
}
|
||||
|
||||
@freezed
|
||||
class Holiday with _$Holiday {
|
||||
abstract class Holiday with _$Holiday {
|
||||
const factory Holiday({
|
||||
required String start,
|
||||
required String end,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,8 @@ part of 'holidays_state.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$HolidaysStateImpl _$$HolidaysStateImplFromJson(Map<String, dynamic> json) =>
|
||||
_$HolidaysStateImpl(
|
||||
_HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) =>
|
||||
_HolidaysState(
|
||||
showPastHolidays: json['showPastHolidays'] as bool,
|
||||
showDisclaimer: json['showDisclaimer'] as bool,
|
||||
holidays: (json['holidays'] as List<dynamic>)
|
||||
@@ -15,29 +15,27 @@ _$HolidaysStateImpl _$$HolidaysStateImplFromJson(Map<String, dynamic> json) =>
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$HolidaysStateImplToJson(_$HolidaysStateImpl instance) =>
|
||||
Map<String, dynamic> _$HolidaysStateToJson(_HolidaysState instance) =>
|
||||
<String, dynamic>{
|
||||
'showPastHolidays': instance.showPastHolidays,
|
||||
'showDisclaimer': instance.showDisclaimer,
|
||||
'holidays': instance.holidays,
|
||||
};
|
||||
|
||||
_$HolidayImpl _$$HolidayImplFromJson(Map<String, dynamic> json) =>
|
||||
_$HolidayImpl(
|
||||
start: json['start'] as String,
|
||||
end: json['end'] as String,
|
||||
year: (json['year'] as num).toInt(),
|
||||
stateCode: json['stateCode'] as String,
|
||||
name: json['name'] as String,
|
||||
slug: json['slug'] as String,
|
||||
);
|
||||
_Holiday _$HolidayFromJson(Map<String, dynamic> json) => _Holiday(
|
||||
start: json['start'] as String,
|
||||
end: json['end'] as String,
|
||||
year: (json['year'] as num).toInt(),
|
||||
stateCode: json['stateCode'] as String,
|
||||
name: json['name'] as String,
|
||||
slug: json['slug'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$HolidayImplToJson(_$HolidayImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'start': instance.start,
|
||||
'end': instance.end,
|
||||
'year': instance.year,
|
||||
'stateCode': instance.stateCode,
|
||||
'name': instance.name,
|
||||
'slug': instance.slug,
|
||||
};
|
||||
Map<String, dynamic> _$HolidayToJson(_Holiday instance) => <String, dynamic>{
|
||||
'start': instance.start,
|
||||
'end': instance.end,
|
||||
'year': instance.year,
|
||||
'stateCode': instance.stateCode,
|
||||
'name': instance.name,
|
||||
'slug': instance.slug,
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ part 'marianum_message_state.g.dart';
|
||||
|
||||
|
||||
@freezed
|
||||
class MarianumMessageState with _$MarianumMessageState {
|
||||
abstract class MarianumMessageState with _$MarianumMessageState {
|
||||
const factory MarianumMessageState({
|
||||
required MarianumMessageList messageList,
|
||||
}) = _MarianumMessageState;
|
||||
@@ -14,7 +14,7 @@ class MarianumMessageState with _$MarianumMessageState {
|
||||
}
|
||||
|
||||
@freezed
|
||||
class MarianumMessageList with _$MarianumMessageList {
|
||||
abstract class MarianumMessageList with _$MarianumMessageList {
|
||||
const factory MarianumMessageList({
|
||||
required String base,
|
||||
required List<MarianumMessage> messages,
|
||||
@@ -24,7 +24,7 @@ class MarianumMessageList with _$MarianumMessageList {
|
||||
}
|
||||
|
||||
@freezed
|
||||
class MarianumMessage with _$MarianumMessage {
|
||||
abstract class MarianumMessage with _$MarianumMessage {
|
||||
const factory MarianumMessage({
|
||||
required String name,
|
||||
required String date,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,45 +6,38 @@ part of 'marianum_message_state.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$MarianumMessageStateImpl _$$MarianumMessageStateImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MarianumMessageStateImpl(
|
||||
messageList: MarianumMessageList.fromJson(
|
||||
json['messageList'] as Map<String, dynamic>),
|
||||
);
|
||||
_MarianumMessageState _$MarianumMessageStateFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _MarianumMessageState(
|
||||
messageList: MarianumMessageList.fromJson(
|
||||
json['messageList'] as Map<String, dynamic>,
|
||||
),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MarianumMessageStateImplToJson(
|
||||
_$MarianumMessageStateImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'messageList': instance.messageList,
|
||||
};
|
||||
Map<String, dynamic> _$MarianumMessageStateToJson(
|
||||
_MarianumMessageState instance,
|
||||
) => <String, dynamic>{'messageList': instance.messageList};
|
||||
|
||||
_$MarianumMessageListImpl _$$MarianumMessageListImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MarianumMessageListImpl(
|
||||
_MarianumMessageList _$MarianumMessageListFromJson(Map<String, dynamic> json) =>
|
||||
_MarianumMessageList(
|
||||
base: json['base'] as String,
|
||||
messages: (json['messages'] as List<dynamic>)
|
||||
.map((e) => MarianumMessage.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MarianumMessageListImplToJson(
|
||||
_$MarianumMessageListImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'base': instance.base,
|
||||
'messages': instance.messages,
|
||||
};
|
||||
Map<String, dynamic> _$MarianumMessageListToJson(
|
||||
_MarianumMessageList instance,
|
||||
) => <String, dynamic>{'base': instance.base, 'messages': instance.messages};
|
||||
|
||||
_$MarianumMessageImpl _$$MarianumMessageImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MarianumMessageImpl(
|
||||
_MarianumMessage _$MarianumMessageFromJson(Map<String, dynamic> json) =>
|
||||
_MarianumMessage(
|
||||
name: json['name'] as String,
|
||||
date: json['date'] as String,
|
||||
url: json['url'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MarianumMessageImplToJson(
|
||||
_$MarianumMessageImpl instance) =>
|
||||
Map<String, dynamic> _$MarianumMessageToJson(_MarianumMessage instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'date': instance.date,
|
||||
|
||||
Reference in New Issue
Block a user