From f657db89af8e9e27b34f47d5429ad6ba139e9576 Mon Sep 17 00:00:00 2001 From: poojapandeyx Date: Fri, 12 Jul 2024 11:56:27 +0530 Subject: [PATCH] register with mobile number change --- lib/features/register/presentation/bloc/register_bloc.dart | 3 ++- lib/features/register/presentation/bloc/register_event.dart | 4 +++- .../presentation/widgets/register_bottom_section.dart | 3 ++- lib/features/register/presentation/widgets/register_form.dart | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/features/register/presentation/bloc/register_bloc.dart b/lib/features/register/presentation/bloc/register_bloc.dart index 82f63bb..2dbd996 100644 --- a/lib/features/register/presentation/bloc/register_bloc.dart +++ b/lib/features/register/presentation/bloc/register_bloc.dart @@ -11,6 +11,7 @@ class RegisterBloc extends Bloc { final TextEditingController countrySelectionTextField = TextEditingController(); String isdcode=""; + String countryId=""; final TextEditingController phoneNumberTextField = TextEditingController(); GlobalKey getFormKey() { @@ -28,7 +29,7 @@ class RegisterBloc extends Bloc { emit(RegisterLoading()); try { Map requestdata={ - "isdCode":event.isdcode, + "countryId":event.id, "phoneNumber":event.phoneNumber }; ResponseData response = await OTPAPI().RequestOTP(requestdata); diff --git a/lib/features/register/presentation/bloc/register_event.dart b/lib/features/register/presentation/bloc/register_event.dart index a826600..3e2e506 100644 --- a/lib/features/register/presentation/bloc/register_event.dart +++ b/lib/features/register/presentation/bloc/register_event.dart @@ -11,11 +11,13 @@ class RegisterSubmitted extends RegisterEvent { final String phoneNumber; final String countryResidence; final String isdcode; + final String id; const RegisterSubmitted( this.phoneNumber, this.countryResidence, - this.isdcode + this.isdcode, + this.id ); @override diff --git a/lib/features/register/presentation/widgets/register_bottom_section.dart b/lib/features/register/presentation/widgets/register_bottom_section.dart index c88b474..c16f9b8 100644 --- a/lib/features/register/presentation/widgets/register_bottom_section.dart +++ b/lib/features/register/presentation/widgets/register_bottom_section.dart @@ -82,7 +82,8 @@ class RegisterBottomSection extends StatelessWidget { RegisterSubmitted( loginBloc.phoneNumberTextField.text, loginBloc.countrySelectionTextField.text, - loginBloc.isdcode + loginBloc.isdcode, + loginBloc.countryId ), ) : null; diff --git a/lib/features/register/presentation/widgets/register_form.dart b/lib/features/register/presentation/widgets/register_form.dart index 5af77bb..8775002 100644 --- a/lib/features/register/presentation/widgets/register_form.dart +++ b/lib/features/register/presentation/widgets/register_form.dart @@ -36,6 +36,7 @@ class RegisterForm extends StatelessWidget { loginBloc.phoneNumberTextField.text = "${countryState.countryModel.data![selectedCountry].isdCode}"; loginBloc.isdcode="${countryState.countryModel.data![selectedCountry].isdCode}"; + loginBloc.countryId="${countryState.countryModel.data![selectedCountry].id}"; flag = "${ApiEndpoints.base}${countryState.countryModel.data![selectedCountry].flagIcon}"; Globalconst.phonenumber=loginBloc.phoneNumberTextField.text;