register with mobile number change
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -82,7 +82,8 @@ class RegisterBottomSection extends StatelessWidget {
|
||||
RegisterSubmitted(
|
||||
loginBloc.phoneNumberTextField.text,
|
||||
loginBloc.countrySelectionTextField.text,
|
||||
loginBloc.isdcode
|
||||
loginBloc.isdcode,
|
||||
loginBloc.countryId
|
||||
),
|
||||
)
|
||||
: null;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user