Added recover password texts to i18n

This commit is contained in:
2025-12-18 10:56:06 +01:00
parent ce062ec6e8
commit f6e07192dc
13 changed files with 238 additions and 79 deletions

View File

@@ -7,24 +7,13 @@ import 'package:navigation/navigation.dart';
import 'package:sf_localizations/sf_localizations.dart';
import 'package:utils/utils.dart';
class NewPasswordScreen extends ConsumerStatefulWidget {
class NewPasswordScreen extends ConsumerWidget {
final NavigationContract navigationContract;
const NewPasswordScreen({super.key, required this.navigationContract});
const NewPasswordScreen({required this.navigationContract});
@override
ConsumerState<NewPasswordScreen> createState() => NewPasswordScreenState();
}
class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
Widget build(BuildContext context, WidgetRef ref) {
final NavigationContract navigationContract = GetIt.I<NavigationContract>();
final theme = ref.watch(themePortProvider);
@@ -40,7 +29,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Recuperar contraseña',
context.translate(LocaleKeys.recoverPasswordTitle),
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w500,
@@ -51,7 +40,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
SizedBox(height: SizeUtils.getByScreen(small: 42, big: 32)),
CustomTextField(
showPassword: viewState.passwordVisible,
label: 'Nueva contraseña',
label: context.translate(LocaleKeys.newPassword),
labelSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12),
hint: '********',
controller: viewModel.passwordController,
@@ -60,7 +49,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
SizedBox(height: 16),
CustomTextField(
showPassword: viewState.passwordVisible,
label: 'Repetir contraseña',
label: context.translate(LocaleKeys.repeatPassword),
labelSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12),
hint: '********',
controller: viewModel.repeatedPasswordController,
@@ -69,16 +58,16 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
),
if (!viewState.equalPasswords) ...[
SizedBox(height: 4),
const Row(
Row(
spacing: 8,
children: [
Icon(
const Icon(
Icons.info_outline_rounded,
color: Color.fromRGBO(239, 17, 17, 1),
size: 16,
),
Text(
'Las contraseñas no coinciden. Inténtalo de nuevo',
context.translate(LocaleKeys.errorMessageUnequalPasswords),
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromRGBO(239, 17, 17, 1),
@@ -100,7 +89,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
: ThemeCode.buttonSecondary),
),
Text(
'Al menos 8 caracteres',
context.translate(LocaleKeys.passwordLength),
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12))
),
],
@@ -116,7 +105,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
: ThemeCode.buttonSecondary),
),
Text(
'Una mayúscula',
context.translate(LocaleKeys.passwordCapital),
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12))
),
],
@@ -132,7 +121,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
: ThemeCode.buttonSecondary),
),
Text(
'Un número',
context.translate(LocaleKeys.passwordNumber),
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12))
),
],
@@ -148,7 +137,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
: ThemeCode.buttonSecondary),
),
Text(
'Un carácter especial',
context.translate(LocaleKeys.passwordSpecial),
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12))
),
],
@@ -157,7 +146,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
Align(
alignment: Alignment.bottomLeft,
child: Text(
'Teléfono móvil',
context.translate(LocaleKeys.mobilePhone),
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12), letterSpacing: 0),
)
),
@@ -175,7 +164,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
},
),
Expanded(child: CustomTextField(
hint: 'Teléfono',
hint: context.translate(LocaleKeys.phoneNumber),
numeric: true,
controller: viewModel.newPhoneNumberController,
))
@@ -184,7 +173,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
if (viewState.errorMessage.isNotEmpty) ...[
SizedBox(height: 10),
Text(
viewState.errorMessage,
context.translate(viewState.errorMessage),
textAlign: TextAlign.center,
style: const TextStyle(
color: Color.fromRGBO(239, 17, 17, 1),
@@ -201,7 +190,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
navigationContract.goTo(AppRoutes.dashboardHome);
}
},
text: 'Aceptar',
text: context.translate(LocaleKeys.accept),
color: theme.getColorFor(ThemeCode.buttonPrimary)
),
],

View File

@@ -29,26 +29,26 @@ class RequestRecoveryScreen extends ConsumerWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Recuperar contaseña",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: SizeUtils.getByScreen(small: 30, big: 30, xl: 26)),
context.translate(LocaleKeys.recoverPasswordTitle),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: SizeUtils.getByScreen(small: 29, big: 29, xl: 26)),
),
SizedBox(height: SizeUtils.getByScreen(small: 24, big: 32)),
Text(
"Introduce tu email para enviarte un enlace de recuperación",
context.translate(LocaleKeys.recoverPasswordSubtitle),
textAlign: TextAlign.center,
style: TextStyle(letterSpacing: 0, fontSize: SizeUtils.getByScreen(small: 18, big: 18, xl: 16)),
),
SizedBox(height: SizeUtils.getByScreen(small: 56, big: 48)),
CustomTextField(
label: "Correo electrónico",
hint: "Correo electrónico",
label: context.translate(LocaleKeys.email),
hint: context.translate(LocaleKeys.email),
controller: viewModel.emailController,
),
SizedBox(height: SizeUtils.getByScreen(small: 40, big: 40, xl: 28)),
Align(
alignment: Alignment.bottomLeft,
child: Text(
"Teléfono móvil",
context.translate(LocaleKeys.mobilePhone),
style: TextStyle(fontSize: 14, letterSpacing: 0),
),
),
@@ -68,7 +68,7 @@ class RequestRecoveryScreen extends ConsumerWidget {
SizedBox(width: SizeUtils.getByScreen(small: 10, big: 10, xl: 6)),
Expanded(
child: CustomTextField(
hint: "Teléfono",
hint: context.translate(I18n.phoneNumber),
numeric: true,
controller: viewModel.phoneNumberController,
),
@@ -78,7 +78,7 @@ class RequestRecoveryScreen extends ConsumerWidget {
SizedBox(height: SizeUtils.getByScreen(small: 40, big: 40, xl: 28)),
if (viewState.errorMessage.isNotEmpty) ...[
Text(
viewState.errorMessage,
context.translate(viewState.errorMessage),
textAlign: TextAlign.center,
style: const TextStyle(
color: Color.fromRGBO(239, 17, 17, 1),
@@ -92,7 +92,7 @@ class RequestRecoveryScreen extends ConsumerWidget {
Expanded(
child: SecondaryButton(
onPressed: () => {Navigator.pop(context)},
text: "Volver",
text: context.translate(LocaleKeys.back),
size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14),
),
),
@@ -111,7 +111,7 @@ class RequestRecoveryScreen extends ConsumerWidget {
);
}
},
text: "Enviar",
text: context.translate(LocaleKeys.send),
size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14),
color: theme.getColorFor(ThemeCode.buttonSecondary),
),

View File

@@ -3,6 +3,7 @@ import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:navigation/navigation.dart';
import 'package:sf_localizations/sf_localizations.dart';
import 'package:utils/utils.dart';
import '../state/recover_password_view_model.dart';
@@ -28,7 +29,7 @@ class SentScreen extends ConsumerWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Recuperar contraseña",
context.translate(LocaleKeys.recoverPasswordTitle),
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w500,
@@ -47,8 +48,8 @@ class SentScreen extends ConsumerWidget {
SizedBox(width: SizeUtils.getByScreen(small: 10, big: 10, xl: 6)),
Text(
viewState.recoveryFormat == "email"
? "Correo enviado correctamente"
: "SMS enviado correctamente",
? context.translate(LocaleKeys.emailSent)
: context.translate(LocaleKeys.smsSent),
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 18, big: 18, xl: 15), fontWeight: FontWeight.bold),
),
],
@@ -56,16 +57,16 @@ class SentScreen extends ConsumerWidget {
SizedBox(height: SizeUtils.getByScreen(small: 48, big: 48, xl: 40)),
Text(
viewState.recoveryFormat == "email"
? "Revisa tu email y haz clic en el enlace para crear una nueva contraseña."
: "Revisa tu móvil y sigue las instrucciones para crear una nueva contraseña.",
? context.translate(LocaleKeys.checkEmail1)
: context.translate(LocaleKeys.checkSms1),
textAlign: TextAlign.center,
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 18, big: 18, xl: 15), letterSpacing: 0),
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 17, big: 17, xl: 15), letterSpacing: 0),
),
SizedBox(height: 16),
Text(
viewState.recoveryFormat == "email"
? "Si no recibes el correo en unos minutos, revisa tu carpeta de spam o pulsa \"Reenviar correo\"."
: "Si no recibes el SMS en unos minutos, asegúrate de tener cobertura o pulsa \"Reenviar SMS \".",
? context.translate(LocaleKeys.checkEmail2)
: context.translate(LocaleKeys.checkSms2),
textAlign: TextAlign.center,
style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12), letterSpacing: 0),
),
@@ -82,8 +83,8 @@ class SentScreen extends ConsumerWidget {
}
},
text: viewState.recoveryFormat == "email"
? "Reenviar correo"
: "Reenviar SMS",
? context.translate(LocaleKeys.resendEmail)
: context.translate(LocaleKeys.resendSms),
size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14),
),
),
@@ -94,7 +95,7 @@ class SentScreen extends ConsumerWidget {
context,
MaterialPageRoute(builder: (_) => NewPasswordScreen(navigationContract: navigationContract)),
),
text: "Continuar",
text: context.translate(LocaleKeys.continueKey),
color: theme.getColorFor(ThemeCode.buttonSecondary),
size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14),
),

View File

@@ -157,6 +157,7 @@ class RecoverPasswordViewModel extends Notifier<RecoverPasswordViewState> {
isLoading: false,
errorMessage: '',
recoveryRequested: true,
token: token,
recoveryFormat: 'email',
);
} catch (e) {
@@ -177,13 +178,14 @@ class RecoverPasswordViewModel extends Notifier<RecoverPasswordViewState> {
final fullPhone = '${state.dialCode}$trimmedNumber';
try {
await _recoverPasswordUseCase.requestSms(phone: fullPhone);
final String token = await _recoverPasswordUseCase.requestSms(phone: fullPhone);
if (!ref.mounted) return;
state = state.copyWith(
isLoading: false,
errorMessage: '',
recoveryRequested: true,
token: token,
recoveryFormat: 'sms'
);
} catch (e) {
@@ -247,8 +249,8 @@ class RecoverPasswordViewModel extends Notifier<RecoverPasswordViewState> {
passwordChanged: false,
);
try {
/*await _recoverPasswordUseCase.recoverPassword(
newPassword: password, token: "");*/
await _recoverPasswordUseCase.recoverPassword(
newPassword: password, token: state.token);
state = state.copyWith(
isLoading: false,
passwordChanged: true,

View File

@@ -13,6 +13,7 @@ abstract class RecoverPasswordViewState with _$RecoverPasswordViewState {
@Default(false) bool isLoading,
@Default(false) bool recoveryRequested,
@Default(false) bool passwordChanged,
@Default('') String token,
@Default('') String password,
@Default('') String repeatedPassword,
@Default(false) bool passwordVisible,

View File

@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$RecoverPasswordViewState {
String get phoneNumber; String get dialCode; String get email; String get errorMessage; String get recoveryFormat; bool get isLoading; bool get recoveryRequested; bool get passwordChanged; String get password; String get repeatedPassword; bool get passwordVisible; bool get equalPasswords; String get newDialCode; String get newPhoneNumber; Map<String, bool> get securityChecks;
String get phoneNumber; String get dialCode; String get email; String get errorMessage; String get recoveryFormat; bool get isLoading; bool get recoveryRequested; bool get passwordChanged; String get token; String get password; String get repeatedPassword; bool get passwordVisible; bool get equalPasswords; String get newDialCode; String get newPhoneNumber; Map<String, bool> get securityChecks;
/// Create a copy of RecoverPasswordViewState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $RecoverPasswordViewStateCopyWith<RecoverPasswordViewState> get copyWith => _$Re
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is RecoverPasswordViewState&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.email, email) || other.email == email)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.recoveryFormat, recoveryFormat) || other.recoveryFormat == recoveryFormat)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.recoveryRequested, recoveryRequested) || other.recoveryRequested == recoveryRequested)&&(identical(other.passwordChanged, passwordChanged) || other.passwordChanged == passwordChanged)&&(identical(other.password, password) || other.password == password)&&(identical(other.repeatedPassword, repeatedPassword) || other.repeatedPassword == repeatedPassword)&&(identical(other.passwordVisible, passwordVisible) || other.passwordVisible == passwordVisible)&&(identical(other.equalPasswords, equalPasswords) || other.equalPasswords == equalPasswords)&&(identical(other.newDialCode, newDialCode) || other.newDialCode == newDialCode)&&(identical(other.newPhoneNumber, newPhoneNumber) || other.newPhoneNumber == newPhoneNumber)&&const DeepCollectionEquality().equals(other.securityChecks, securityChecks));
return identical(this, other) || (other.runtimeType == runtimeType&&other is RecoverPasswordViewState&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.email, email) || other.email == email)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.recoveryFormat, recoveryFormat) || other.recoveryFormat == recoveryFormat)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.recoveryRequested, recoveryRequested) || other.recoveryRequested == recoveryRequested)&&(identical(other.passwordChanged, passwordChanged) || other.passwordChanged == passwordChanged)&&(identical(other.token, token) || other.token == token)&&(identical(other.password, password) || other.password == password)&&(identical(other.repeatedPassword, repeatedPassword) || other.repeatedPassword == repeatedPassword)&&(identical(other.passwordVisible, passwordVisible) || other.passwordVisible == passwordVisible)&&(identical(other.equalPasswords, equalPasswords) || other.equalPasswords == equalPasswords)&&(identical(other.newDialCode, newDialCode) || other.newDialCode == newDialCode)&&(identical(other.newPhoneNumber, newPhoneNumber) || other.newPhoneNumber == newPhoneNumber)&&const DeepCollectionEquality().equals(other.securityChecks, securityChecks));
}
@override
int get hashCode => Object.hash(runtimeType,phoneNumber,dialCode,email,errorMessage,recoveryFormat,isLoading,recoveryRequested,passwordChanged,password,repeatedPassword,passwordVisible,equalPasswords,newDialCode,newPhoneNumber,const DeepCollectionEquality().hash(securityChecks));
int get hashCode => Object.hash(runtimeType,phoneNumber,dialCode,email,errorMessage,recoveryFormat,isLoading,recoveryRequested,passwordChanged,token,password,repeatedPassword,passwordVisible,equalPasswords,newDialCode,newPhoneNumber,const DeepCollectionEquality().hash(securityChecks));
@override
String toString() {
return 'RecoverPasswordViewState(phoneNumber: $phoneNumber, dialCode: $dialCode, email: $email, errorMessage: $errorMessage, recoveryFormat: $recoveryFormat, isLoading: $isLoading, recoveryRequested: $recoveryRequested, passwordChanged: $passwordChanged, password: $password, repeatedPassword: $repeatedPassword, passwordVisible: $passwordVisible, equalPasswords: $equalPasswords, newDialCode: $newDialCode, newPhoneNumber: $newPhoneNumber, securityChecks: $securityChecks)';
return 'RecoverPasswordViewState(phoneNumber: $phoneNumber, dialCode: $dialCode, email: $email, errorMessage: $errorMessage, recoveryFormat: $recoveryFormat, isLoading: $isLoading, recoveryRequested: $recoveryRequested, passwordChanged: $passwordChanged, token: $token, password: $password, repeatedPassword: $repeatedPassword, passwordVisible: $passwordVisible, equalPasswords: $equalPasswords, newDialCode: $newDialCode, newPhoneNumber: $newPhoneNumber, securityChecks: $securityChecks)';
}
@@ -45,7 +45,7 @@ abstract mixin class $RecoverPasswordViewStateCopyWith<$Res> {
factory $RecoverPasswordViewStateCopyWith(RecoverPasswordViewState value, $Res Function(RecoverPasswordViewState) _then) = _$RecoverPasswordViewStateCopyWithImpl;
@useResult
$Res call({
String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks
String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String token, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks
});
@@ -62,7 +62,7 @@ class _$RecoverPasswordViewStateCopyWithImpl<$Res>
/// Create a copy of RecoverPasswordViewState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? phoneNumber = null,Object? dialCode = null,Object? email = null,Object? errorMessage = null,Object? recoveryFormat = null,Object? isLoading = null,Object? recoveryRequested = null,Object? passwordChanged = null,Object? password = null,Object? repeatedPassword = null,Object? passwordVisible = null,Object? equalPasswords = null,Object? newDialCode = null,Object? newPhoneNumber = null,Object? securityChecks = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? phoneNumber = null,Object? dialCode = null,Object? email = null,Object? errorMessage = null,Object? recoveryFormat = null,Object? isLoading = null,Object? recoveryRequested = null,Object? passwordChanged = null,Object? token = null,Object? password = null,Object? repeatedPassword = null,Object? passwordVisible = null,Object? equalPasswords = null,Object? newDialCode = null,Object? newPhoneNumber = null,Object? securityChecks = null,}) {
return _then(_self.copyWith(
phoneNumber: null == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable
as String,dialCode: null == dialCode ? _self.dialCode : dialCode // ignore: cast_nullable_to_non_nullable
@@ -72,7 +72,8 @@ as String,recoveryFormat: null == recoveryFormat ? _self.recoveryFormat : recove
as String,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,recoveryRequested: null == recoveryRequested ? _self.recoveryRequested : recoveryRequested // ignore: cast_nullable_to_non_nullable
as bool,passwordChanged: null == passwordChanged ? _self.passwordChanged : passwordChanged // ignore: cast_nullable_to_non_nullable
as bool,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as bool,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
as String,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String,repeatedPassword: null == repeatedPassword ? _self.repeatedPassword : repeatedPassword // ignore: cast_nullable_to_non_nullable
as String,passwordVisible: null == passwordVisible ? _self.passwordVisible : passwordVisible // ignore: cast_nullable_to_non_nullable
as bool,equalPasswords: null == equalPasswords ? _self.equalPasswords : equalPasswords // ignore: cast_nullable_to_non_nullable
@@ -164,10 +165,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String token, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _RecoverPasswordViewState() when $default != null:
return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,_that.recoveryFormat,_that.isLoading,_that.recoveryRequested,_that.passwordChanged,_that.password,_that.repeatedPassword,_that.passwordVisible,_that.equalPasswords,_that.newDialCode,_that.newPhoneNumber,_that.securityChecks);case _:
return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,_that.recoveryFormat,_that.isLoading,_that.recoveryRequested,_that.passwordChanged,_that.token,_that.password,_that.repeatedPassword,_that.passwordVisible,_that.equalPasswords,_that.newDialCode,_that.newPhoneNumber,_that.securityChecks);case _:
return orElse();
}
@@ -185,10 +186,10 @@ return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String token, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks) $default,) {final _that = this;
switch (_that) {
case _RecoverPasswordViewState():
return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,_that.recoveryFormat,_that.isLoading,_that.recoveryRequested,_that.passwordChanged,_that.password,_that.repeatedPassword,_that.passwordVisible,_that.equalPasswords,_that.newDialCode,_that.newPhoneNumber,_that.securityChecks);case _:
return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,_that.recoveryFormat,_that.isLoading,_that.recoveryRequested,_that.passwordChanged,_that.token,_that.password,_that.repeatedPassword,_that.passwordVisible,_that.equalPasswords,_that.newDialCode,_that.newPhoneNumber,_that.securityChecks);case _:
throw StateError('Unexpected subclass');
}
@@ -205,10 +206,10 @@ return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String token, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks)? $default,) {final _that = this;
switch (_that) {
case _RecoverPasswordViewState() when $default != null:
return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,_that.recoveryFormat,_that.isLoading,_that.recoveryRequested,_that.passwordChanged,_that.password,_that.repeatedPassword,_that.passwordVisible,_that.equalPasswords,_that.newDialCode,_that.newPhoneNumber,_that.securityChecks);case _:
return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,_that.recoveryFormat,_that.isLoading,_that.recoveryRequested,_that.passwordChanged,_that.token,_that.password,_that.repeatedPassword,_that.passwordVisible,_that.equalPasswords,_that.newDialCode,_that.newPhoneNumber,_that.securityChecks);case _:
return null;
}
@@ -220,7 +221,7 @@ return $default(_that.phoneNumber,_that.dialCode,_that.email,_that.errorMessage,
class _RecoverPasswordViewState implements RecoverPasswordViewState {
const _RecoverPasswordViewState({this.phoneNumber = '', this.dialCode = '+34', this.email = '', this.errorMessage = '', this.recoveryFormat = '', this.isLoading = false, this.recoveryRequested = false, this.passwordChanged = false, this.password = '', this.repeatedPassword = '', this.passwordVisible = false, this.equalPasswords = true, this.newDialCode = '+34', this.newPhoneNumber = '', final Map<String, bool> securityChecks = const {'min' : false, 'capital' : false, 'number' : false, 'special' : false}}): _securityChecks = securityChecks;
const _RecoverPasswordViewState({this.phoneNumber = '', this.dialCode = '+34', this.email = '', this.errorMessage = '', this.recoveryFormat = '', this.isLoading = false, this.recoveryRequested = false, this.passwordChanged = false, this.token = '', this.password = '', this.repeatedPassword = '', this.passwordVisible = false, this.equalPasswords = true, this.newDialCode = '+34', this.newPhoneNumber = '', final Map<String, bool> securityChecks = const {'min' : false, 'capital' : false, 'number' : false, 'special' : false}}): _securityChecks = securityChecks;
@override@JsonKey() final String phoneNumber;
@@ -231,6 +232,7 @@ class _RecoverPasswordViewState implements RecoverPasswordViewState {
@override@JsonKey() final bool isLoading;
@override@JsonKey() final bool recoveryRequested;
@override@JsonKey() final bool passwordChanged;
@override@JsonKey() final String token;
@override@JsonKey() final String password;
@override@JsonKey() final String repeatedPassword;
@override@JsonKey() final bool passwordVisible;
@@ -255,16 +257,16 @@ _$RecoverPasswordViewStateCopyWith<_RecoverPasswordViewState> get copyWith => __
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _RecoverPasswordViewState&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.email, email) || other.email == email)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.recoveryFormat, recoveryFormat) || other.recoveryFormat == recoveryFormat)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.recoveryRequested, recoveryRequested) || other.recoveryRequested == recoveryRequested)&&(identical(other.passwordChanged, passwordChanged) || other.passwordChanged == passwordChanged)&&(identical(other.password, password) || other.password == password)&&(identical(other.repeatedPassword, repeatedPassword) || other.repeatedPassword == repeatedPassword)&&(identical(other.passwordVisible, passwordVisible) || other.passwordVisible == passwordVisible)&&(identical(other.equalPasswords, equalPasswords) || other.equalPasswords == equalPasswords)&&(identical(other.newDialCode, newDialCode) || other.newDialCode == newDialCode)&&(identical(other.newPhoneNumber, newPhoneNumber) || other.newPhoneNumber == newPhoneNumber)&&const DeepCollectionEquality().equals(other._securityChecks, _securityChecks));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _RecoverPasswordViewState&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.email, email) || other.email == email)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.recoveryFormat, recoveryFormat) || other.recoveryFormat == recoveryFormat)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.recoveryRequested, recoveryRequested) || other.recoveryRequested == recoveryRequested)&&(identical(other.passwordChanged, passwordChanged) || other.passwordChanged == passwordChanged)&&(identical(other.token, token) || other.token == token)&&(identical(other.password, password) || other.password == password)&&(identical(other.repeatedPassword, repeatedPassword) || other.repeatedPassword == repeatedPassword)&&(identical(other.passwordVisible, passwordVisible) || other.passwordVisible == passwordVisible)&&(identical(other.equalPasswords, equalPasswords) || other.equalPasswords == equalPasswords)&&(identical(other.newDialCode, newDialCode) || other.newDialCode == newDialCode)&&(identical(other.newPhoneNumber, newPhoneNumber) || other.newPhoneNumber == newPhoneNumber)&&const DeepCollectionEquality().equals(other._securityChecks, _securityChecks));
}
@override
int get hashCode => Object.hash(runtimeType,phoneNumber,dialCode,email,errorMessage,recoveryFormat,isLoading,recoveryRequested,passwordChanged,password,repeatedPassword,passwordVisible,equalPasswords,newDialCode,newPhoneNumber,const DeepCollectionEquality().hash(_securityChecks));
int get hashCode => Object.hash(runtimeType,phoneNumber,dialCode,email,errorMessage,recoveryFormat,isLoading,recoveryRequested,passwordChanged,token,password,repeatedPassword,passwordVisible,equalPasswords,newDialCode,newPhoneNumber,const DeepCollectionEquality().hash(_securityChecks));
@override
String toString() {
return 'RecoverPasswordViewState(phoneNumber: $phoneNumber, dialCode: $dialCode, email: $email, errorMessage: $errorMessage, recoveryFormat: $recoveryFormat, isLoading: $isLoading, recoveryRequested: $recoveryRequested, passwordChanged: $passwordChanged, password: $password, repeatedPassword: $repeatedPassword, passwordVisible: $passwordVisible, equalPasswords: $equalPasswords, newDialCode: $newDialCode, newPhoneNumber: $newPhoneNumber, securityChecks: $securityChecks)';
return 'RecoverPasswordViewState(phoneNumber: $phoneNumber, dialCode: $dialCode, email: $email, errorMessage: $errorMessage, recoveryFormat: $recoveryFormat, isLoading: $isLoading, recoveryRequested: $recoveryRequested, passwordChanged: $passwordChanged, token: $token, password: $password, repeatedPassword: $repeatedPassword, passwordVisible: $passwordVisible, equalPasswords: $equalPasswords, newDialCode: $newDialCode, newPhoneNumber: $newPhoneNumber, securityChecks: $securityChecks)';
}
@@ -275,7 +277,7 @@ abstract mixin class _$RecoverPasswordViewStateCopyWith<$Res> implements $Recove
factory _$RecoverPasswordViewStateCopyWith(_RecoverPasswordViewState value, $Res Function(_RecoverPasswordViewState) _then) = __$RecoverPasswordViewStateCopyWithImpl;
@override @useResult
$Res call({
String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks
String phoneNumber, String dialCode, String email, String errorMessage, String recoveryFormat, bool isLoading, bool recoveryRequested, bool passwordChanged, String token, String password, String repeatedPassword, bool passwordVisible, bool equalPasswords, String newDialCode, String newPhoneNumber, Map<String, bool> securityChecks
});
@@ -292,7 +294,7 @@ class __$RecoverPasswordViewStateCopyWithImpl<$Res>
/// Create a copy of RecoverPasswordViewState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? phoneNumber = null,Object? dialCode = null,Object? email = null,Object? errorMessage = null,Object? recoveryFormat = null,Object? isLoading = null,Object? recoveryRequested = null,Object? passwordChanged = null,Object? password = null,Object? repeatedPassword = null,Object? passwordVisible = null,Object? equalPasswords = null,Object? newDialCode = null,Object? newPhoneNumber = null,Object? securityChecks = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? phoneNumber = null,Object? dialCode = null,Object? email = null,Object? errorMessage = null,Object? recoveryFormat = null,Object? isLoading = null,Object? recoveryRequested = null,Object? passwordChanged = null,Object? token = null,Object? password = null,Object? repeatedPassword = null,Object? passwordVisible = null,Object? equalPasswords = null,Object? newDialCode = null,Object? newPhoneNumber = null,Object? securityChecks = null,}) {
return _then(_RecoverPasswordViewState(
phoneNumber: null == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable
as String,dialCode: null == dialCode ? _self.dialCode : dialCode // ignore: cast_nullable_to_non_nullable
@@ -302,7 +304,8 @@ as String,recoveryFormat: null == recoveryFormat ? _self.recoveryFormat : recove
as String,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,recoveryRequested: null == recoveryRequested ? _self.recoveryRequested : recoveryRequested // ignore: cast_nullable_to_non_nullable
as bool,passwordChanged: null == passwordChanged ? _self.passwordChanged : passwordChanged // ignore: cast_nullable_to_non_nullable
as bool,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as bool,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
as String,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String,repeatedPassword: null == repeatedPassword ? _self.repeatedPassword : repeatedPassword // ignore: cast_nullable_to_non_nullable
as String,passwordVisible: null == passwordVisible ? _self.passwordVisible : passwordVisible // ignore: cast_nullable_to_non_nullable
as bool,equalPasswords: null == equalPasswords ? _self.equalPasswords : equalPasswords // ignore: cast_nullable_to_non_nullable