|
|
|
|
@ -90,13 +90,22 @@ class _WelcomeLogin extends State<WelcomeLogin> {
|
|
|
|
|
late int isHijri;
|
|
|
|
|
var healthId;
|
|
|
|
|
|
|
|
|
|
late FocusNode _focusNode;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
isLoading = true;
|
|
|
|
|
super.initState();
|
|
|
|
|
_focusNode = FocusNode();
|
|
|
|
|
phoneController = TextEditingController();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_focusNode.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
projectViewModel = context.read<ProjectViewModel>();
|
|
|
|
|
@ -172,6 +181,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
|
|
|
|
|
removePadding: true,
|
|
|
|
|
prefix: null,
|
|
|
|
|
hasSelection: false,
|
|
|
|
|
autoFocus: true,
|
|
|
|
|
isBorderAllowed: false,
|
|
|
|
|
isAllowLeadingIcon: true,
|
|
|
|
|
padding: EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8),
|
|
|
|
|
@ -190,6 +200,8 @@ class _WelcomeLogin extends State<WelcomeLogin> {
|
|
|
|
|
isDismissible: false,
|
|
|
|
|
useSafeArea: true,
|
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
|
enableDrag: false,
|
|
|
|
|
// Prevent dragging to avoid focus conflicts
|
|
|
|
|
builder: (bottomSheetContext) => StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom),
|
|
|
|
|
@ -198,6 +210,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
|
|
|
|
|
countryCode: selectedCountry.countryCode,
|
|
|
|
|
initialPhoneNumber: phoneNumber != null ? phoneNumber : "",
|
|
|
|
|
textController: phoneController,
|
|
|
|
|
focusNode: _focusNode,
|
|
|
|
|
isEnableCountryDropdown: true,
|
|
|
|
|
onCountryChange: (value) {
|
|
|
|
|
selectedCountry = value;
|
|
|
|
|
@ -205,6 +218,15 @@ class _WelcomeLogin extends State<WelcomeLogin> {
|
|
|
|
|
},
|
|
|
|
|
onChange: (String? value) {
|
|
|
|
|
phoneNumber = value;
|
|
|
|
|
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
// Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
|
// if (mounted && _focusNode.canRequestFocus) {
|
|
|
|
|
// _focusNode.requestFocus();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
FocusNode().requestFocus(_focusNode);
|
|
|
|
|
},
|
|
|
|
|
buttons: [
|
|
|
|
|
Padding(
|
|
|
|
|
@ -342,13 +364,13 @@ class _WelcomeLogin extends State<WelcomeLogin> {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
context.showBottomSheet(
|
|
|
|
|
child: ExceptionBottomSheet(
|
|
|
|
|
message: err.toString(),
|
|
|
|
|
showCancel: true,
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
Navigator.of(context).push(FadePage(page: RegisterNew()));
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
message: err.toString(),
|
|
|
|
|
showCancel: true,
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
Navigator.of(context).push(FadePage(page: RegisterNew()));
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
projectViewModel.analytics.loginRegistration.login_fail(error: err.toString());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -438,14 +460,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
|
|
|
|
|
if (activation.errorCode == '699') {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
onWrongActivationCode(activation.errorEndUserMessage);
|
|
|
|
|
// context.showBottomSheet(
|
|
|
|
|
// child: ExceptionBottomSheet(
|
|
|
|
|
// message: activation.errorEndUserMessage,
|
|
|
|
|
// onOkPressed: () {
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
return;
|
|
|
|
|
} else if (registerd_data?.isRegister == true) {
|
|
|
|
|
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew));
|
|
|
|
|
|