338 lines
12 KiB
Dart
338 lines
12 KiB
Dart
// 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
|
|
|
|
part of 'login_data.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$LoginData {
|
|
|
|
Customer? get customer; ErrorModel? get error;@JsonKey(name: 'access_token') String? get accessToken;@JsonKey(name: 'refresh_token') String? get refreshToken;@JsonKey(name: 'expires_at') int? get expiresAt;
|
|
/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$LoginDataCopyWith<LoginData> get copyWith => _$LoginDataCopyWithImpl<LoginData>(this as LoginData, _$identity);
|
|
|
|
/// Serializes this LoginData to a JSON map.
|
|
Map<String, dynamic> toJson();
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoginData&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.error, error) || other.error == error)&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.expiresAt, expiresAt) || other.expiresAt == expiresAt));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,customer,error,accessToken,refreshToken,expiresAt);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'LoginData(customer: $customer, error: $error, accessToken: $accessToken, refreshToken: $refreshToken, expiresAt: $expiresAt)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $LoginDataCopyWith<$Res> {
|
|
factory $LoginDataCopyWith(LoginData value, $Res Function(LoginData) _then) = _$LoginDataCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
Customer? customer, ErrorModel? error,@JsonKey(name: 'access_token') String? accessToken,@JsonKey(name: 'refresh_token') String? refreshToken,@JsonKey(name: 'expires_at') int? expiresAt
|
|
});
|
|
|
|
|
|
$CustomerCopyWith<$Res>? get customer;$ErrorModelCopyWith<$Res>? get error;
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$LoginDataCopyWithImpl<$Res>
|
|
implements $LoginDataCopyWith<$Res> {
|
|
_$LoginDataCopyWithImpl(this._self, this._then);
|
|
|
|
final LoginData _self;
|
|
final $Res Function(LoginData) _then;
|
|
|
|
/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? customer = freezed,Object? error = freezed,Object? accessToken = freezed,Object? refreshToken = freezed,Object? expiresAt = freezed,}) {
|
|
return _then(_self.copyWith(
|
|
customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable
|
|
as Customer?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
|
as ErrorModel?,accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,expiresAt: freezed == expiresAt ? _self.expiresAt : expiresAt // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
));
|
|
}
|
|
/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$CustomerCopyWith<$Res>? get customer {
|
|
if (_self.customer == null) {
|
|
return null;
|
|
}
|
|
|
|
return $CustomerCopyWith<$Res>(_self.customer!, (value) {
|
|
return _then(_self.copyWith(customer: value));
|
|
});
|
|
}/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$ErrorModelCopyWith<$Res>? get error {
|
|
if (_self.error == null) {
|
|
return null;
|
|
}
|
|
|
|
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
|
|
return _then(_self.copyWith(error: value));
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
/// Adds pattern-matching-related methods to [LoginData].
|
|
extension LoginDataPatterns on LoginData {
|
|
/// 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( _LoginData value)? $default,{required TResult orElse(),}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _LoginData() 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( _LoginData value) $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _LoginData():
|
|
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( _LoginData value)? $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _LoginData() 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( Customer? customer, ErrorModel? error, @JsonKey(name: 'access_token') String? accessToken, @JsonKey(name: 'refresh_token') String? refreshToken, @JsonKey(name: 'expires_at') int? expiresAt)? $default,{required TResult orElse(),}) {final _that = this;
|
|
switch (_that) {
|
|
case _LoginData() when $default != null:
|
|
return $default(_that.customer,_that.error,_that.accessToken,_that.refreshToken,_that.expiresAt);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( Customer? customer, ErrorModel? error, @JsonKey(name: 'access_token') String? accessToken, @JsonKey(name: 'refresh_token') String? refreshToken, @JsonKey(name: 'expires_at') int? expiresAt) $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _LoginData():
|
|
return $default(_that.customer,_that.error,_that.accessToken,_that.refreshToken,_that.expiresAt);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( Customer? customer, ErrorModel? error, @JsonKey(name: 'access_token') String? accessToken, @JsonKey(name: 'refresh_token') String? refreshToken, @JsonKey(name: 'expires_at') int? expiresAt)? $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _LoginData() when $default != null:
|
|
return $default(_that.customer,_that.error,_that.accessToken,_that.refreshToken,_that.expiresAt);case _:
|
|
return null;
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
|
|
class _LoginData implements LoginData {
|
|
const _LoginData({required this.customer, required this.error, @JsonKey(name: 'access_token') required this.accessToken, @JsonKey(name: 'refresh_token') required this.refreshToken, @JsonKey(name: 'expires_at') required this.expiresAt});
|
|
factory _LoginData.fromJson(Map<String, dynamic> json) => _$LoginDataFromJson(json);
|
|
|
|
@override final Customer? customer;
|
|
@override final ErrorModel? error;
|
|
@override@JsonKey(name: 'access_token') final String? accessToken;
|
|
@override@JsonKey(name: 'refresh_token') final String? refreshToken;
|
|
@override@JsonKey(name: 'expires_at') final int? expiresAt;
|
|
|
|
/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$LoginDataCopyWith<_LoginData> get copyWith => __$LoginDataCopyWithImpl<_LoginData>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$LoginDataToJson(this, );
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoginData&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.error, error) || other.error == error)&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.expiresAt, expiresAt) || other.expiresAt == expiresAt));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,customer,error,accessToken,refreshToken,expiresAt);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'LoginData(customer: $customer, error: $error, accessToken: $accessToken, refreshToken: $refreshToken, expiresAt: $expiresAt)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$LoginDataCopyWith<$Res> implements $LoginDataCopyWith<$Res> {
|
|
factory _$LoginDataCopyWith(_LoginData value, $Res Function(_LoginData) _then) = __$LoginDataCopyWithImpl;
|
|
@override @useResult
|
|
$Res call({
|
|
Customer? customer, ErrorModel? error,@JsonKey(name: 'access_token') String? accessToken,@JsonKey(name: 'refresh_token') String? refreshToken,@JsonKey(name: 'expires_at') int? expiresAt
|
|
});
|
|
|
|
|
|
@override $CustomerCopyWith<$Res>? get customer;@override $ErrorModelCopyWith<$Res>? get error;
|
|
|
|
}
|
|
/// @nodoc
|
|
class __$LoginDataCopyWithImpl<$Res>
|
|
implements _$LoginDataCopyWith<$Res> {
|
|
__$LoginDataCopyWithImpl(this._self, this._then);
|
|
|
|
final _LoginData _self;
|
|
final $Res Function(_LoginData) _then;
|
|
|
|
/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? customer = freezed,Object? error = freezed,Object? accessToken = freezed,Object? refreshToken = freezed,Object? expiresAt = freezed,}) {
|
|
return _then(_LoginData(
|
|
customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable
|
|
as Customer?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
|
as ErrorModel?,accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,expiresAt: freezed == expiresAt ? _self.expiresAt : expiresAt // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
));
|
|
}
|
|
|
|
/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$CustomerCopyWith<$Res>? get customer {
|
|
if (_self.customer == null) {
|
|
return null;
|
|
}
|
|
|
|
return $CustomerCopyWith<$Res>(_self.customer!, (value) {
|
|
return _then(_self.copyWith(customer: value));
|
|
});
|
|
}/// Create a copy of LoginData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$ErrorModelCopyWith<$Res>? get error {
|
|
if (_self.error == null) {
|
|
return null;
|
|
}
|
|
|
|
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
|
|
return _then(_self.copyWith(error: value));
|
|
});
|
|
}
|
|
}
|
|
|
|
// dart format on
|