feat: sending otp and resend otp done
This commit is contained in:
@@ -3,5 +3,6 @@ abstract class TimeDelayConst {
|
||||
static const Duration durationMill300 = Duration(milliseconds: 300);
|
||||
static const Duration durationMill800 = Duration(milliseconds: 800);
|
||||
static const Duration durationMill3500 = Duration(milliseconds: 3500);
|
||||
static const Duration duration1 = Duration(seconds: 1);
|
||||
static const Duration duration3 = Duration(seconds: 3);
|
||||
}
|
||||
|
||||
@@ -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/verify_otp_bloc/verify_otp_bloc.dart'
|
||||
as _i323;
|
||||
import '../../feature/auth/presentation/blocs/verify_phone_bloc/verify_phone_bloc.dart'
|
||||
as _i224;
|
||||
import '../../feature/basket/presentation/blocs/basket_bloc.dart' as _i728;
|
||||
import '../../feature/browse/presentation/blocs/browse_bloc/browse_bloc.dart'
|
||||
as _i991;
|
||||
@@ -101,6 +105,20 @@ extension GetItInjectableX on _i174.GetIt {
|
||||
gh.factory<_i406.VerifyOtpCodeRegisterUseCase>(
|
||||
() => _i406.VerifyOtpCodeRegisterUseCase(gh<_i884.AuthRepository>()),
|
||||
);
|
||||
gh.factory<_i323.VerifyOtpBloc>(
|
||||
() => _i323.VerifyOtpBloc(
|
||||
gh<_i406.VerifyOtpCodeRegisterUseCase>(),
|
||||
gh<_i318.VerifyOtpCodeForgotPasswordUseCase>(),
|
||||
gh<_i664.VerifyPhoneRegisterUseCase>(),
|
||||
gh<_i801.VerifyPhoneNumberLoginUseCase>(),
|
||||
),
|
||||
);
|
||||
gh.factory<_i224.VerifyPhoneBloc>(
|
||||
() => _i224.VerifyPhoneBloc(
|
||||
gh<_i801.VerifyPhoneNumberLoginUseCase>(),
|
||||
gh<_i664.VerifyPhoneRegisterUseCase>(),
|
||||
),
|
||||
);
|
||||
gh.factory<_i1065.LoginBloc>(
|
||||
() => _i1065.LoginBloc(
|
||||
gh<_i241.LoginUseCase>(),
|
||||
|
||||
8
lib/core/helpers/time_formatters.dart
Normal file
8
lib/core/helpers/time_formatters.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
abstract class TimeFormatters {
|
||||
static String formatMinutesToTime(int totalMinutes) {
|
||||
final hours = totalMinutes ~/ 60;
|
||||
final minutes = totalMinutes % 60;
|
||||
|
||||
return '${hours.toString().padLeft(2, '0')}:${minutes.toString().padLeft(2, '0')}';
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:food_delivery_client/feature/auth/domain/usecases/verify_otp_code_login_usecase.dart';
|
||||
import 'package:food_delivery_client/feature/auth/presentation/pages/forgot_password_page/forgot_password_page.dart';
|
||||
import 'package:food_delivery_client/feature/auth/presentation/pages/login_page/login_page.dart';
|
||||
import 'package:food_delivery_client/feature/auth/presentation/pages/register_page/register_page.dart';
|
||||
@@ -25,7 +26,9 @@ class AppRoutes {
|
||||
|
||||
GoRoute(
|
||||
path: Routes.register,
|
||||
pageBuilder: (context, state) => CupertinoPage(child: RegisterPage()),
|
||||
pageBuilder: (context, state) => CupertinoPage(
|
||||
child: RegisterPage(phoneNumber: state.extra as String),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: Routes.forgotPassword,
|
||||
@@ -42,14 +45,15 @@ class AppRoutes {
|
||||
GoRoute(
|
||||
path: Routes.verifyOtpCode,
|
||||
pageBuilder: (context, state) => CupertinoPage(
|
||||
child: VerifyOtpCodePage(isRegister: state.extra as bool),
|
||||
child: VerifyOtpCodePage(params: state.extra as OtpCodePageParams),
|
||||
),
|
||||
),
|
||||
|
||||
GoRoute(
|
||||
path: Routes.resetPassword,
|
||||
pageBuilder: (context, state) =>
|
||||
CupertinoPage(child: ResetPasswordPage()),
|
||||
pageBuilder: (context, state) => CupertinoPage(
|
||||
child: ResetPasswordPage(phoneNumber: state.extra as String),
|
||||
),
|
||||
),
|
||||
|
||||
GoRoute(
|
||||
|
||||
Reference in New Issue
Block a user