|
|
|
|
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
|
|
|
|
|
/// @nodoc
|
|
|
|
|
mixin _$ContactsViewState {
|
|
|
|
|
|
|
|
|
|
List<ContactEntity> get contacts; bool get isLoading; bool get isEditing; String get errorMessage;
|
|
|
|
|
List<ContactEntity> get contacts; String get dialCode; bool get isLoading; bool get isEditing; String get errorMessage;
|
|
|
|
|
/// Create a copy of ContactsViewState
|
|
|
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
|
|
|
@@ -25,16 +25,16 @@ $ContactsViewStateCopyWith<ContactsViewState> get copyWith => _$ContactsViewStat
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is ContactsViewState&&const DeepCollectionEquality().equals(other.contacts, contacts)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isEditing, isEditing) || other.isEditing == isEditing)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
|
|
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is ContactsViewState&&const DeepCollectionEquality().equals(other.contacts, contacts)&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isEditing, isEditing) || other.isEditing == isEditing)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(contacts),isLoading,isEditing,errorMessage);
|
|
|
|
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(contacts),dialCode,isLoading,isEditing,errorMessage);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() {
|
|
|
|
|
return 'ContactsViewState(contacts: $contacts, isLoading: $isLoading, isEditing: $isEditing, errorMessage: $errorMessage)';
|
|
|
|
|
return 'ContactsViewState(contacts: $contacts, dialCode: $dialCode, isLoading: $isLoading, isEditing: $isEditing, errorMessage: $errorMessage)';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -45,7 +45,7 @@ abstract mixin class $ContactsViewStateCopyWith<$Res> {
|
|
|
|
|
factory $ContactsViewStateCopyWith(ContactsViewState value, $Res Function(ContactsViewState) _then) = _$ContactsViewStateCopyWithImpl;
|
|
|
|
|
@useResult
|
|
|
|
|
$Res call({
|
|
|
|
|
List<ContactEntity> contacts, bool isLoading, bool isEditing, String errorMessage
|
|
|
|
|
List<ContactEntity> contacts, String dialCode, bool isLoading, bool isEditing, String errorMessage
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -62,10 +62,11 @@ class _$ContactsViewStateCopyWithImpl<$Res>
|
|
|
|
|
|
|
|
|
|
/// Create a copy of ContactsViewState
|
|
|
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
|
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? contacts = null,Object? isLoading = null,Object? isEditing = null,Object? errorMessage = null,}) {
|
|
|
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? contacts = null,Object? dialCode = null,Object? isLoading = null,Object? isEditing = null,Object? errorMessage = null,}) {
|
|
|
|
|
return _then(_self.copyWith(
|
|
|
|
|
contacts: null == contacts ? _self.contacts : contacts // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as List<ContactEntity>,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as List<ContactEntity>,dialCode: null == dialCode ? _self.dialCode : dialCode // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as String,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as bool,isEditing: null == isEditing ? _self.isEditing : isEditing // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as bool,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as String,
|
|
|
|
|
@@ -153,10 +154,10 @@ return $default(_that);case _:
|
|
|
|
|
/// }
|
|
|
|
|
/// ```
|
|
|
|
|
|
|
|
|
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<ContactEntity> contacts, bool isLoading, bool isEditing, String errorMessage)? $default,{required TResult orElse(),}) {final _that = this;
|
|
|
|
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<ContactEntity> contacts, String dialCode, bool isLoading, bool isEditing, String errorMessage)? $default,{required TResult orElse(),}) {final _that = this;
|
|
|
|
|
switch (_that) {
|
|
|
|
|
case _ContactsViewState() when $default != null:
|
|
|
|
|
return $default(_that.contacts,_that.isLoading,_that.isEditing,_that.errorMessage);case _:
|
|
|
|
|
return $default(_that.contacts,_that.dialCode,_that.isLoading,_that.isEditing,_that.errorMessage);case _:
|
|
|
|
|
return orElse();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@@ -174,10 +175,10 @@ return $default(_that.contacts,_that.isLoading,_that.isEditing,_that.errorMessag
|
|
|
|
|
/// }
|
|
|
|
|
/// ```
|
|
|
|
|
|
|
|
|
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<ContactEntity> contacts, bool isLoading, bool isEditing, String errorMessage) $default,) {final _that = this;
|
|
|
|
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<ContactEntity> contacts, String dialCode, bool isLoading, bool isEditing, String errorMessage) $default,) {final _that = this;
|
|
|
|
|
switch (_that) {
|
|
|
|
|
case _ContactsViewState():
|
|
|
|
|
return $default(_that.contacts,_that.isLoading,_that.isEditing,_that.errorMessage);case _:
|
|
|
|
|
return $default(_that.contacts,_that.dialCode,_that.isLoading,_that.isEditing,_that.errorMessage);case _:
|
|
|
|
|
throw StateError('Unexpected subclass');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@@ -194,10 +195,10 @@ return $default(_that.contacts,_that.isLoading,_that.isEditing,_that.errorMessag
|
|
|
|
|
/// }
|
|
|
|
|
/// ```
|
|
|
|
|
|
|
|
|
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<ContactEntity> contacts, bool isLoading, bool isEditing, String errorMessage)? $default,) {final _that = this;
|
|
|
|
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<ContactEntity> contacts, String dialCode, bool isLoading, bool isEditing, String errorMessage)? $default,) {final _that = this;
|
|
|
|
|
switch (_that) {
|
|
|
|
|
case _ContactsViewState() when $default != null:
|
|
|
|
|
return $default(_that.contacts,_that.isLoading,_that.isEditing,_that.errorMessage);case _:
|
|
|
|
|
return $default(_that.contacts,_that.dialCode,_that.isLoading,_that.isEditing,_that.errorMessage);case _:
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@@ -209,7 +210,7 @@ return $default(_that.contacts,_that.isLoading,_that.isEditing,_that.errorMessag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _ContactsViewState implements ContactsViewState {
|
|
|
|
|
const _ContactsViewState({final List<ContactEntity> contacts = const [], this.isLoading = true, this.isEditing = false, this.errorMessage = ''}): _contacts = contacts;
|
|
|
|
|
const _ContactsViewState({final List<ContactEntity> contacts = const [], this.dialCode = '+34', this.isLoading = true, this.isEditing = false, this.errorMessage = ''}): _contacts = contacts;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final List<ContactEntity> _contacts;
|
|
|
|
|
@@ -219,6 +220,7 @@ class _ContactsViewState implements ContactsViewState {
|
|
|
|
|
return EqualUnmodifiableListView(_contacts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override@JsonKey() final String dialCode;
|
|
|
|
|
@override@JsonKey() final bool isLoading;
|
|
|
|
|
@override@JsonKey() final bool isEditing;
|
|
|
|
|
@override@JsonKey() final String errorMessage;
|
|
|
|
|
@@ -233,16 +235,16 @@ _$ContactsViewStateCopyWith<_ContactsViewState> get copyWith => __$ContactsViewS
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ContactsViewState&&const DeepCollectionEquality().equals(other._contacts, _contacts)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isEditing, isEditing) || other.isEditing == isEditing)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
|
|
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ContactsViewState&&const DeepCollectionEquality().equals(other._contacts, _contacts)&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isEditing, isEditing) || other.isEditing == isEditing)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_contacts),isLoading,isEditing,errorMessage);
|
|
|
|
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_contacts),dialCode,isLoading,isEditing,errorMessage);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() {
|
|
|
|
|
return 'ContactsViewState(contacts: $contacts, isLoading: $isLoading, isEditing: $isEditing, errorMessage: $errorMessage)';
|
|
|
|
|
return 'ContactsViewState(contacts: $contacts, dialCode: $dialCode, isLoading: $isLoading, isEditing: $isEditing, errorMessage: $errorMessage)';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -253,7 +255,7 @@ abstract mixin class _$ContactsViewStateCopyWith<$Res> implements $ContactsViewS
|
|
|
|
|
factory _$ContactsViewStateCopyWith(_ContactsViewState value, $Res Function(_ContactsViewState) _then) = __$ContactsViewStateCopyWithImpl;
|
|
|
|
|
@override @useResult
|
|
|
|
|
$Res call({
|
|
|
|
|
List<ContactEntity> contacts, bool isLoading, bool isEditing, String errorMessage
|
|
|
|
|
List<ContactEntity> contacts, String dialCode, bool isLoading, bool isEditing, String errorMessage
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -270,10 +272,11 @@ class __$ContactsViewStateCopyWithImpl<$Res>
|
|
|
|
|
|
|
|
|
|
/// Create a copy of ContactsViewState
|
|
|
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
|
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? contacts = null,Object? isLoading = null,Object? isEditing = null,Object? errorMessage = null,}) {
|
|
|
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? contacts = null,Object? dialCode = null,Object? isLoading = null,Object? isEditing = null,Object? errorMessage = null,}) {
|
|
|
|
|
return _then(_ContactsViewState(
|
|
|
|
|
contacts: null == contacts ? _self._contacts : contacts // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as List<ContactEntity>,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as List<ContactEntity>,dialCode: null == dialCode ? _self.dialCode : dialCode // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as String,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as bool,isEditing: null == isEditing ? _self.isEditing : isEditing // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as bool,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
|
|
|
|
|
as String,
|
|
|
|
|
|