ForgotPasswordScreen with neutral reaction (F12), CheckEmail reset mode on its own path, recovery link handling and ResetPasswordScreen with the recovery guard held until the user confirms the success message. Carries the from parameter between login, register and forgot password. Removes the route placeholders. Refs #1 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
369 lines
10 KiB
Dart
369 lines
10 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// coverage:ignore-file
|
|
// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package
|
|
// 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 'auth_status.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
/// @nodoc
|
|
mixin _$AuthStatus {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthStatus);
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode => runtimeType.hashCode;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthStatus()';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
class $AuthStatusCopyWith<$Res> {
|
|
$AuthStatusCopyWith(AuthStatus _, $Res Function(AuthStatus) __);
|
|
}
|
|
|
|
|
|
/// Adds pattern-matching-related methods to [AuthStatus].
|
|
extension AuthStatusPatterns on AuthStatus {
|
|
/// 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( SignedOut value)? signedOut,TResult Function( SignedIn value)? signedIn,TResult Function( PasswordRecovery value)? passwordRecovery,required TResult orElse(),}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case SignedOut() when signedOut != null:
|
|
return signedOut(_that);case SignedIn() when signedIn != null:
|
|
return signedIn(_that);case PasswordRecovery() when passwordRecovery != null:
|
|
return passwordRecovery(_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?>({required TResult Function( SignedOut value) signedOut,required TResult Function( SignedIn value) signedIn,required TResult Function( PasswordRecovery value) passwordRecovery,}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case SignedOut():
|
|
return signedOut(_that);case SignedIn():
|
|
return signedIn(_that);case PasswordRecovery():
|
|
return passwordRecovery(_that);}
|
|
}
|
|
/// 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( SignedOut value)? signedOut,TResult? Function( SignedIn value)? signedIn,TResult? Function( PasswordRecovery value)? passwordRecovery,}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case SignedOut() when signedOut != null:
|
|
return signedOut(_that);case SignedIn() when signedIn != null:
|
|
return signedIn(_that);case PasswordRecovery() when passwordRecovery != null:
|
|
return passwordRecovery(_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()? signedOut,TResult Function( AuthUser user)? signedIn,TResult Function( AuthUser user, bool passwordChanged)? passwordRecovery,required TResult orElse(),}) {final _that = this;
|
|
switch (_that) {
|
|
case SignedOut() when signedOut != null:
|
|
return signedOut();case SignedIn() when signedIn != null:
|
|
return signedIn(_that.user);case PasswordRecovery() when passwordRecovery != null:
|
|
return passwordRecovery(_that.user,_that.passwordChanged);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?>({required TResult Function() signedOut,required TResult Function( AuthUser user) signedIn,required TResult Function( AuthUser user, bool passwordChanged) passwordRecovery,}) {final _that = this;
|
|
switch (_that) {
|
|
case SignedOut():
|
|
return signedOut();case SignedIn():
|
|
return signedIn(_that.user);case PasswordRecovery():
|
|
return passwordRecovery(_that.user,_that.passwordChanged);}
|
|
}
|
|
/// 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()? signedOut,TResult? Function( AuthUser user)? signedIn,TResult? Function( AuthUser user, bool passwordChanged)? passwordRecovery,}) {final _that = this;
|
|
switch (_that) {
|
|
case SignedOut() when signedOut != null:
|
|
return signedOut();case SignedIn() when signedIn != null:
|
|
return signedIn(_that.user);case PasswordRecovery() when passwordRecovery != null:
|
|
return passwordRecovery(_that.user,_that.passwordChanged);case _:
|
|
return null;
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
|
|
class SignedOut extends AuthStatus {
|
|
const SignedOut(): super._();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SignedOut);
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode => runtimeType.hashCode;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthStatus.signedOut()';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// @nodoc
|
|
|
|
|
|
class SignedIn extends AuthStatus {
|
|
const SignedIn(this.user): super._();
|
|
|
|
|
|
final AuthUser user;
|
|
|
|
/// Create a copy of AuthStatus
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$SignedInCopyWith<SignedIn> get copyWith => _$SignedInCopyWithImpl<SignedIn>(this, _$identity);
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SignedIn&&(identical(other.user, user) || other.user == user));
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(runtimeType,user);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthStatus.signedIn(user: $user)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $SignedInCopyWith<$Res> implements $AuthStatusCopyWith<$Res> {
|
|
factory $SignedInCopyWith(SignedIn value, $Res Function(SignedIn) _then) = _$SignedInCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
AuthUser user
|
|
});
|
|
|
|
|
|
$AuthUserCopyWith<$Res> get user;
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$SignedInCopyWithImpl<$Res>
|
|
implements $SignedInCopyWith<$Res> {
|
|
_$SignedInCopyWithImpl(this._self, this._then);
|
|
|
|
final SignedIn _self;
|
|
final $Res Function(SignedIn) _then;
|
|
|
|
/// Create a copy of AuthStatus
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') $Res call({Object? user = null,}) {
|
|
return _then(SignedIn(
|
|
null == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
|
as AuthUser,
|
|
));
|
|
}
|
|
|
|
/// Create a copy of AuthStatus
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$AuthUserCopyWith<$Res> get user {
|
|
|
|
return $AuthUserCopyWith<$Res>(_self.user, (value) {
|
|
return _then(_self.copyWith(user: value));
|
|
});
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
|
|
class PasswordRecovery extends AuthStatus {
|
|
const PasswordRecovery(this.user, {this.passwordChanged = false}): super._();
|
|
|
|
|
|
final AuthUser user;
|
|
@JsonKey() final bool passwordChanged;
|
|
|
|
/// Create a copy of AuthStatus
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$PasswordRecoveryCopyWith<PasswordRecovery> get copyWith => _$PasswordRecoveryCopyWithImpl<PasswordRecovery>(this, _$identity);
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is PasswordRecovery&&(identical(other.user, user) || other.user == user)&&(identical(other.passwordChanged, passwordChanged) || other.passwordChanged == passwordChanged));
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(runtimeType,user,passwordChanged);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthStatus.passwordRecovery(user: $user, passwordChanged: $passwordChanged)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $PasswordRecoveryCopyWith<$Res> implements $AuthStatusCopyWith<$Res> {
|
|
factory $PasswordRecoveryCopyWith(PasswordRecovery value, $Res Function(PasswordRecovery) _then) = _$PasswordRecoveryCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
AuthUser user, bool passwordChanged
|
|
});
|
|
|
|
|
|
$AuthUserCopyWith<$Res> get user;
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$PasswordRecoveryCopyWithImpl<$Res>
|
|
implements $PasswordRecoveryCopyWith<$Res> {
|
|
_$PasswordRecoveryCopyWithImpl(this._self, this._then);
|
|
|
|
final PasswordRecovery _self;
|
|
final $Res Function(PasswordRecovery) _then;
|
|
|
|
/// Create a copy of AuthStatus
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') $Res call({Object? user = null,Object? passwordChanged = null,}) {
|
|
return _then(PasswordRecovery(
|
|
null == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
|
as AuthUser,passwordChanged: null == passwordChanged ? _self.passwordChanged : passwordChanged // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
));
|
|
}
|
|
|
|
/// Create a copy of AuthStatus
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$AuthUserCopyWith<$Res> get user {
|
|
|
|
return $AuthUserCopyWith<$Res>(_self.user, (value) {
|
|
return _then(_self.copyWith(user: value));
|
|
});
|
|
}
|
|
}
|
|
|
|
// dart format on
|