feat: auth done
This commit is contained in:
@@ -30,6 +30,10 @@ import '../../feature/auth/domain/usecases/verify_phone_register_usecase.dart'
|
||||
as _i664;
|
||||
import '../../feature/auth/presentation/blocs/login_bloc/login_bloc.dart'
|
||||
as _i1065;
|
||||
import '../../feature/auth/presentation/blocs/register_bloc/register_bloc.dart'
|
||||
as _i1050;
|
||||
import '../../feature/auth/presentation/blocs/reset_password_bloc/reset_password_bloc.dart'
|
||||
as _i97;
|
||||
import '../../feature/auth/presentation/blocs/verify_otp_bloc/verify_otp_bloc.dart'
|
||||
as _i323;
|
||||
import '../../feature/auth/presentation/blocs/verify_phone_bloc/verify_phone_bloc.dart'
|
||||
@@ -119,6 +123,12 @@ extension GetItInjectableX on _i174.GetIt {
|
||||
gh<_i664.VerifyPhoneRegisterUseCase>(),
|
||||
),
|
||||
);
|
||||
gh.factory<_i1050.RegisterBloc>(
|
||||
() => _i1050.RegisterBloc(gh<_i607.RegisterUseCase>()),
|
||||
);
|
||||
gh.factory<_i97.ResetPasswordBloc>(
|
||||
() => _i97.ResetPasswordBloc(gh<_i694.ResetPasswordUseCase>()),
|
||||
);
|
||||
gh.factory<_i1065.LoginBloc>(
|
||||
() => _i1065.LoginBloc(
|
||||
gh<_i241.LoginUseCase>(),
|
||||
|
||||
@@ -19,10 +19,31 @@ abstract class Validators {
|
||||
return null;
|
||||
}
|
||||
|
||||
static String? validateRepeatPassword(
|
||||
String repeatPassword,
|
||||
String password,
|
||||
) {
|
||||
if (repeatPassword.isEmpty) {
|
||||
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
|
||||
} else if (repeatPassword != password) {
|
||||
return navigatorKey.currentContext?.loc.passwords_do_not_match;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static String? validateFields(String value) {
|
||||
if (value.isEmpty) {
|
||||
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static String? validateOtpFields(String value) {
|
||||
if (value.isEmpty) {
|
||||
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
|
||||
} else if (value.length < 5) {
|
||||
return navigatorKey.currentContext?.loc.otp_code_incomplete;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -867,6 +867,42 @@ abstract class AppLocalizations {
|
||||
/// In en, this message translates to:
|
||||
/// **'By proceeding, you consent to get calls or SMS messages, including by automated means, from {appName} and its affiliates to the number provided.'**
|
||||
String consent_message(String appName);
|
||||
|
||||
/// No description provided for @otp_code_incomplete.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Code is incomplete. Please enter the full code.'**
|
||||
String get otp_code_incomplete;
|
||||
|
||||
/// No description provided for @passwords_do_not_match.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Passwords do not match.'**
|
||||
String get passwords_do_not_match;
|
||||
|
||||
/// No description provided for @reset_password.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Reset password'**
|
||||
String get reset_password;
|
||||
|
||||
/// No description provided for @new_password.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'New password'**
|
||||
String get new_password;
|
||||
|
||||
/// No description provided for @enter_otp_code.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter the 5-digit code sent to you at {phoneNumber}'**
|
||||
String enter_otp_code(String phoneNumber);
|
||||
|
||||
/// No description provided for @resend_otp_after.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'You can resend OTP after'**
|
||||
String get resend_otp_after;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -406,4 +406,25 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
String consent_message(String appName) {
|
||||
return 'By proceeding, you consent to get calls or SMS messages, including by automated means, from $appName and its affiliates to the number provided.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get otp_code_incomplete =>
|
||||
'Code is incomplete. Please enter the full code.';
|
||||
|
||||
@override
|
||||
String get passwords_do_not_match => 'Passwords do not match.';
|
||||
|
||||
@override
|
||||
String get reset_password => 'Reset password';
|
||||
|
||||
@override
|
||||
String get new_password => 'New password';
|
||||
|
||||
@override
|
||||
String enter_otp_code(String phoneNumber) {
|
||||
return 'Enter the 5-digit code sent to you at $phoneNumber';
|
||||
}
|
||||
|
||||
@override
|
||||
String get resend_otp_after => 'You can resend OTP after';
|
||||
}
|
||||
|
||||
@@ -406,4 +406,25 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
String consent_message(String appName) {
|
||||
return 'Продолжая, вы соглашаетесь получать звонки или SMS-сообщения, включая автоматические, от $appName и его партнёров на указанный номер.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get otp_code_incomplete =>
|
||||
'Код неполный. Пожалуйста, введите полный код.';
|
||||
|
||||
@override
|
||||
String get passwords_do_not_match => 'Пароли не совпадают.';
|
||||
|
||||
@override
|
||||
String get reset_password => 'Восстановить пароль';
|
||||
|
||||
@override
|
||||
String get new_password => 'Новый пароль';
|
||||
|
||||
@override
|
||||
String enter_otp_code(String phoneNumber) {
|
||||
return 'Введите 5-значный код, отправленный на номер $phoneNumber';
|
||||
}
|
||||
|
||||
@override
|
||||
String get resend_otp_after => 'Вы можете повторно отправить код через';
|
||||
}
|
||||
|
||||
@@ -407,4 +407,25 @@ class AppLocalizationsUz extends AppLocalizations {
|
||||
String consent_message(String appName) {
|
||||
return 'Davom etish orqali siz $appName va uning hamkorlaridan siz kiritgan raqamga, shu jumladan avtomatik vositalar orqali, qo‘ng‘iroqlar yoki SMS xabarlar olishingizga rozilik bildirasiz.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get otp_code_incomplete =>
|
||||
'Kod yetarli emas. Iltimos, to‘liq kodni kiriting.';
|
||||
|
||||
@override
|
||||
String get passwords_do_not_match => 'Parollar mos kelmadi.';
|
||||
|
||||
@override
|
||||
String get reset_password => 'Parolni qayta tiklash';
|
||||
|
||||
@override
|
||||
String get new_password => 'Yangi parol';
|
||||
|
||||
@override
|
||||
String enter_otp_code(String phoneNumber) {
|
||||
return '$phoneNumber raqamiga yuborilgan 5 xonali kodni kiriting';
|
||||
}
|
||||
|
||||
@override
|
||||
String get resend_otp_after => 'OTP kodni qayta yuborish mumkin bo‘ladi';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user