feat(registration): add phone

This commit is contained in:
Alex
2024-12-18 13:34:47 +03:00
parent 12a24e6ead
commit f0cdb73496
8 changed files with 151 additions and 62 deletions

View File

@@ -40,6 +40,7 @@ class RegistrationCubit extends Cubit<RegistrationState> {
favoriteFoods: '',
unfavoriteFoods: '',
additionalInfo: '',
phone: '',
),
),
);
@@ -48,7 +49,11 @@ class RegistrationCubit extends Cubit<RegistrationState> {
Future<void> tryRegistration() async {
try {
final token = await registrationRepository.tryRegister(state.sheet);
final token = await registrationRepository.tryRegister(
state.sheet.copyWith(
phone: state.sheet.phone.replaceAll(' ', '').replaceAll('(', '').replaceAll(')', ''),
),
);
await TokenStorage.saveTokenInStorage(token);
AppRouter.navigatorKey.currentContext?.go('/my-profile-screen');
} catch (e) {