register with mobile number change

This commit is contained in:
poojapandeyx
2024-07-12 11:56:27 +05:30
parent acf7f8980f
commit f657db89af
4 changed files with 8 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
final TextEditingController countrySelectionTextField =
TextEditingController();
String isdcode="";
String countryId="";
final TextEditingController phoneNumberTextField = TextEditingController();
GlobalKey<FormState> getFormKey() {
@@ -28,7 +29,7 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
emit(RegisterLoading());
try {
Map<String,dynamic> requestdata={
"isdCode":event.isdcode,
"countryId":event.id,
"phoneNumber":event.phoneNumber
};
ResponseData response = await OTPAPI().RequestOTP(requestdata);

View File

@@ -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

View File

@@ -82,7 +82,8 @@ class RegisterBottomSection extends StatelessWidget {
RegisterSubmitted(
loginBloc.phoneNumberTextField.text,
loginBloc.countrySelectionTextField.text,
loginBloc.isdcode
loginBloc.isdcode,
loginBloc.countryId
),
)
: null;

View File

@@ -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;