pull/8/head
aamir-csol 2 months ago
parent 23a4035117
commit d1e1154bdb

@ -13,6 +13,7 @@ import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/dialogs/confirm_dialog.dart'; import 'package:hmg_patient_app_new/widgets/dialogs/confirm_dialog.dart';
@ -66,7 +67,6 @@ class Utils {
hours: isAddHours ? 3 : 0, hours: isAddHours ? 3 : 0,
), ),
)); ));
;
} }
static String convertStringToDateTime(String dateTimeString) { static String convertStringToDateTime(String dateTimeString) {
@ -236,7 +236,8 @@ class Utils {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (cxt) => ConfirmDialog( builder: (cxt) =>
ConfirmDialog(
title: title!, title: title!,
message: message!, message: message!,
onTap: onTap, onTap: onTap,
@ -371,7 +372,9 @@ class Utils {
static String formatHijriDateToDisplay(String hijriDateString) { static String formatHijriDateToDisplay(String hijriDateString) {
try { try {
// Assuming hijriDateString is in the format yyyy-MM-dd // Assuming hijriDateString is in the format yyyy-MM-dd
final datePart = hijriDateString.split("T").first; final datePart = hijriDateString
.split("T")
.first;
final parts = datePart.split('-'); final parts = datePart.split('-');
if (parts.length != 3) return ""; if (parts.length != 3) return "";
@ -429,8 +432,14 @@ class Utils {
void Function(LottieComposition)? onLoaded, void Function(LottieComposition)? onLoaded,
}) { }) {
return Lottie.asset(assetPath, return Lottie.asset(assetPath,
height: height ?? MediaQuery.of(context).size.height * 0.26, height: height ?? MediaQuery
width: width ?? MediaQuery.of(context).size.width, .of(context)
.size
.height * 0.26,
width: width ?? MediaQuery
.of(context)
.size
.width,
fit: fit, fit: fit,
alignment: alignment, alignment: alignment,
repeat: repeat, repeat: repeat,
@ -487,9 +496,13 @@ class Utils {
], ],
); );
} }
static Future<bool> isGoogleServicesAvailable() async { static Future<bool> isGoogleServicesAvailable() async {
GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability(); GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability();
String status = availability.toString().split('.').last; String status = availability
.toString()
.split('.')
.last;
if (status == "success") { if (status == "success") {
return true; return true;
} }
@ -510,3 +523,26 @@ class Utils {
return crypto.md5.convert(utf8.encode(input)).toString(); return crypto.md5.convert(utf8.encode(input)).toString();
} }
} }
class ValidationUtils {
static DialogService dialogService = getIt.get<DialogService>();
static bool isValidatePhoneAndId({
String? nationalId,
String? phoneNumber
}) {
if (nationalId == null || nationalId.isEmpty) {
dialogService.showErrorDialog(message: "Please enter a valid national ID or file number", onOkPressed: () {});
return false;
}
if (phoneNumber == null || phoneNumber.isEmpty) {
dialogService.showErrorDialog(message: "Please enter a valid phone number", onOkPressed: () {});
return false;
}
return true;
}
}

@ -240,6 +240,8 @@ extension EmailValidator on String {
style: TextStyle(height: 47 / 36, color: color ?? AppColors.blackColor, fontSize: 36.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.w600 : FontWeight.normal), style: TextStyle(height: 47 / 36, color: color ?? AppColors.blackColor, fontSize: 36.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.w600 : FontWeight.normal),
); );
Widget toText44({Color? color, bool isBold = false}) => Text( Widget toText44({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle(height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 44.fSize, letterSpacing: -0.4, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 44.fSize, letterSpacing: -0.4, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
@ -381,53 +383,55 @@ class FontUtils {
} }
} }
extension CountryExtension on Country {
extension CountryExtension on CountryEnum {
String get displayName { String get displayName {
switch (this) { switch (this) {
case Country.saudiArabia: case CountryEnum.saudiArabia:
return "Kingdom Of Saudi Arabia"; return "Kingdom Of Saudi Arabia";
case Country.unitedArabEmirates: case CountryEnum.unitedArabEmirates:
return "United Arab Emirates"; return "United Arab Emirates";
} }
} }
String get nameArabic { String get nameArabic {
switch (this) { switch (this) {
case Country.saudiArabia: case CountryEnum.saudiArabia:
return "المملكة العربية السعودية"; return "المملكة العربية السعودية";
case Country.unitedArabEmirates: case CountryEnum.unitedArabEmirates:
return "الإمارات العربية المتحدة"; return "الإمارات العربية المتحدة";
} }
} }
String get iconPath { String get iconPath {
switch (this) { switch (this) {
case Country.saudiArabia: case CountryEnum.saudiArabia:
return AppAssets.ksa; return AppAssets.ksa;
case Country.unitedArabEmirates: case CountryEnum.unitedArabEmirates:
return AppAssets.uae; return AppAssets.uae;
} }
} }
String get countryCode { String get countryCode {
switch (this) { switch (this) {
case Country.saudiArabia: case CountryEnum.saudiArabia:
return "966"; return "966";
case Country.unitedArabEmirates: case CountryEnum.unitedArabEmirates:
return "971"; return "971";
} }
} }
static Country fromDisplayName(String name) { static CountryEnum fromDisplayName(String name) {
switch (name) { switch (name) {
case "Kingdom Of Saudi Arabia": case "Kingdom Of Saudi Arabia":
case "المملكة العربية السعودية": case "المملكة العربية السعودية":
return Country.saudiArabia; return CountryEnum.saudiArabia;
case "United Arab Emirates": case "United Arab Emirates":
case "الإمارات العربية المتحدة": case "الإمارات العربية المتحدة":
return Country.unitedArabEmirates; return CountryEnum.unitedArabEmirates;
default: default:
throw Exception("Invalid country name"); throw Exception("Invalid country name");
} }
} }
} }

@ -20,8 +20,7 @@ abstract class AuthenticationRepo {
required CheckPatientAuthenticationReq checkPatientAuthenticationReq, required CheckPatientAuthenticationReq checkPatientAuthenticationReq,
}); });
Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRegister( Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRegister({required CheckPatientAuthenticationReq checkPatientAuthenticationReq, String? languageID});
{required CheckPatientAuthenticationReq checkPatientAuthenticationReq, String? languageID});
} }
class AuthenticationRepoImp implements AuthenticationRepo { class AuthenticationRepoImp implements AuthenticationRepo {
@ -114,8 +113,7 @@ class AuthenticationRepoImp implements AuthenticationRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRegister( Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRegister({required CheckPatientAuthenticationReq checkPatientAuthenticationReq, String? languageID}) async {
{required CheckPatientAuthenticationReq checkPatientAuthenticationReq, String? languageID}) async {
int isOutKsa = (checkPatientAuthenticationReq.zipCode == '966' || checkPatientAuthenticationReq.zipCode == '+966') ? 0 : 1; int isOutKsa = (checkPatientAuthenticationReq.zipCode == '966' || checkPatientAuthenticationReq.zipCode == '+966') ? 0 : 1;
//TODO : We will use all these from AppState directly in the ApiClient //TODO : We will use all these from AppState directly in the ApiClient

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/request_utils.dart'; import 'package:hmg_patient_app_new/core/utils/request_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_repo.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_repo.dart';
import 'package:hmg_patient_app_new/features/authentication/models/request_models/check_patient_authentication_request_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/request_models/check_patient_authentication_request_model.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart';
@ -23,9 +24,15 @@ class AuthenticationViewModel extends ChangeNotifier {
final TextEditingController nationalIdController = TextEditingController(); final TextEditingController nationalIdController = TextEditingController();
final TextEditingController phoneNumberController = TextEditingController(); final TextEditingController phoneNumberController = TextEditingController();
void login() {
if (ValidationUtils.isValidatePhoneAndId(nationalId: nationalIdController.text, phoneNumber: phoneNumberController.text)) {
} else {
}
}
Future<void> selectDeviceImei({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> selectDeviceImei({Function(dynamic)? onSuccess, Function(String)? onError}) async {
String firebaseToken = String firebaseToken = "dOGRRszQQMGe_9wA5Hx3kO:APA91bFV5IcIJXvcCXXk0tc2ddtZgWwCPq7sGSuPr-YW7iiJpQZKgFGN9GAzCVOWL8MfheaP1slE8MdxB7lczdPBGdONQ7WbMmhgHcsUCUktq-hsapGXXqc";
"dOGRRszQQMGe_9wA5Hx3kO:APA91bFV5IcIJXvcCXXk0tc2ddtZgWwCPq7sGSuPr-YW7iiJpQZKgFGN9GAzCVOWL8MfheaP1slE8MdxB7lczdPBGdONQ7WbMmhgHcsUCUktq-hsapGXXqc";
final result = await authenticationRepo.selectDeviceByImei(firebaseToken: firebaseToken); final result = await authenticationRepo.selectDeviceByImei(firebaseToken: firebaseToken);
result.fold( result.fold(
@ -40,96 +47,96 @@ class AuthenticationViewModel extends ChangeNotifier {
); );
} }
// Future<void> checkUserAuthentication({Function(dynamic)? onSuccess, Function(String)? onError}) async { // Future<void> checkUserAuthentication({Function(dynamic)? onSuccess, Function(String)? onError}) async {
// CheckPatientAuthenticationReq checkPatientAuthenticationReq = RequestUtils.getCommonRequestWelcome( // CheckPatientAuthenticationReq checkPatientAuthenticationReq = RequestUtils.getCommonRequestWelcome(
// phoneNumber: '0567184134', // phoneNumber: '0567184134',
// otpTypeEnum: OTPTypeEnum.sms, // otpTypeEnum: OTPTypeEnum.sms,
// deviceToken: 'dummyDeviceToken123', // deviceToken: 'dummyDeviceToken123',
// patientOutSA: true, // patientOutSA: true,
// loginTokenID: 'dummyLoginToken456', // loginTokenID: 'dummyLoginToken456',
// registeredData: null, // registeredData: null,
// patientId: 12345, // patientId: 12345,
// nationIdText: '1234567890', // nationIdText: '1234567890',
// countryCode: 'SA', // countryCode: 'SA',
// ); // );
// //
// final result = await authenticationRepo.checkPatientAuthentication(checkPatientAuthenticationReq: checkPatientAuthenticationReq); // final result = await authenticationRepo.checkPatientAuthentication(checkPatientAuthenticationReq: checkPatientAuthenticationReq);
// result.fold( // result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
// (apiResponse) { // (apiResponse) {
// if (apiResponse.data['isSMSSent']) { // if (apiResponse.data['isSMSSent']) {
// // TODO: set this in AppState // // TODO: set this in AppState
// // sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); // // sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);
// // loginTokenID = value['LogInTokenID'], // // loginTokenID = value['LogInTokenID'],
// // sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), // // sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
// sendActivationCode(type); // sendActivationCode(type);
// } else { // } else {
// if (apiResponse.data['IsAuthenticated']) { // if (apiResponse.data['IsAuthenticated']) {
// checkActivationCode(onWrongActivationCode: (String? message) {}); // checkActivationCode(onWrongActivationCode: (String? message) {});
// } // }
// } // }
// }, // },
// ); // );
// } // }
// Future<void> sendActivationCode({required OTPTypeEnum otpTypeEnum}) async { // Future<void> sendActivationCode({required OTPTypeEnum otpTypeEnum}) async {
// var request = RequestUtils.getCommonRequestAuthProvider( // var request = RequestUtils.getCommonRequestAuthProvider(
// otpTypeEnum: otpTypeEnum, // otpTypeEnum: otpTypeEnum,
// registeredData: null, // registeredData: null,
// deviceToken: "dummyLoginToken456", // deviceToken: "dummyLoginToken456",
// mobileNumber: "0567184134", // mobileNumber: "0567184134",
// zipCode: "SA", // zipCode: "SA",
// patientOutSA: true, // patientOutSA: true,
// loginTokenID: "dummyLoginToken456", // loginTokenID: "dummyLoginToken456",
// selectedOption: selectedOption, // selectedOption: selectedOption,
// patientId: 12345, // patientId: 12345,
// ); // );
// //
// request.sMSSignature = await SMSOTP.getSignature(); // request.sMSSignature = await SMSOTP.getSignature();
// selectedOption = type; // selectedOption = type;
// // GifLoaderDialogUtils.showMyDialog(context); // // GifLoaderDialogUtils.showMyDialog(context);
// if (healthId != null || isDubai) { // if (healthId != null || isDubai) {
// if (!isDubai) { // if (!isDubai) {
// request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); // request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
// } // }
// request.healthId = healthId; // request.healthId = healthId;
// request.isHijri = isHijri; // request.isHijri = isHijri;
// await this.apiClient.sendActivationCodeRegister(request).then((result) { // await this.apiClient.sendActivationCodeRegister(request).then((result) {
// // GifLoaderDialogUtils.hideDialog(context); // // GifLoaderDialogUtils.hideDialog(context);
// if (result != null && result['isSMSSent'] == true) { // if (result != null && result['isSMSSent'] == true) {
// this.startSMSService(type); // this.startSMSService(type);
// } // }
// }).catchError((r) { // }).catchError((r) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
// context.showBottomSheet( // context.showBottomSheet(
// child: ExceptionBottomSheet( // child: ExceptionBottomSheet(
// message: r.toString(), // message: r.toString(),
// onOkPressed: () { // onOkPressed: () {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
// }, // },
// )); // ));
// // AppToast.showErrorToast(message: r); // // AppToast.showErrorToast(message: r);
// }); // });
// } else { // } else {
// request.dob = ""; // request.dob = "";
// request.healthId = ""; // request.healthId = "";
// request.isHijri = 0; // request.isHijri = 0;
// await this.authService.sendActivationCode(request).then((result) { // await this.authService.sendActivationCode(request).then((result) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
// if (result != null && result['isSMSSent'] == true) { // if (result != null && result['isSMSSent'] == true) {
// this.startSMSService(type); // this.startSMSService(type);
// } // }
// }).catchError((r) { // }).catchError((r) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
// context.showBottomSheet( // context.showBottomSheet(
// child: ExceptionBottomSheet( // child: ExceptionBottomSheet(
// message: r.toString(), // message: r.toString(),
// onOkPressed: () { // onOkPressed: () {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
// }, // },
// )); // ));
// // AppToast.showErrorToast(message: r.toString()); // // AppToast.showErrorToast(message: r.toString());
// }); // });
// } // }
// } // }
} }

@ -7,6 +7,7 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/context_extensions.dart'; import 'package:hmg_patient_app_new/extensions/context_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/authentication/register.dart'; import 'package:hmg_patient_app_new/presentation/authentication/register.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
@ -14,6 +15,7 @@ import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart';
import 'package:hmg_patient_app_new/widgets/bottomsheet/generic_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/bottomsheet/generic_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:provider/provider.dart';
class LoginScreen extends StatefulWidget { class LoginScreen extends StatefulWidget {
@override @override
@ -33,6 +35,7 @@ class _LoginScreen extends State<LoginScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthenticationViewModel authVm = context.read<AuthenticationViewModel>();
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
appBar: CustomAppBar( appBar: CustomAppBar(
@ -61,7 +64,7 @@ class _LoginScreen extends State<LoginScreen> {
TextInputWidget( TextInputWidget(
labelText: "${LocaleKeys.nationalId.tr()} / ${LocaleKeys.fileNo.tr()}", labelText: "${LocaleKeys.nationalId.tr()} / ${LocaleKeys.fileNo.tr()}",
hintText: "xxxxxxxxx", hintText: "xxxxxxxxx",
controller: TextEditingController(), controller: authVm.nationalIdController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
isEnable: true, isEnable: true,
prefix: null, prefix: null,
@ -80,7 +83,7 @@ class _LoginScreen extends State<LoginScreen> {
icon: AppAssets.login1, icon: AppAssets.login1,
iconColor: Colors.white, iconColor: Colors.white,
onPressed: () { onPressed: () {
showLoginModel(context: context); showLoginModel(context: context, textController: authVm.phoneNumberController);
// if (nationIdController.text.isNotEmpty) { // if (nationIdController.text.isNotEmpty) {
// } else { // } else {
@ -150,7 +153,7 @@ class _LoginScreen extends State<LoginScreen> {
child: GenericBottomSheet( child: GenericBottomSheet(
countryCode: "966", countryCode: "966",
initialPhoneNumber: "", initialPhoneNumber: "",
textController: TextEditingController(), textController: textController,
isEnableCountryDropdown: true, isEnableCountryDropdown: true,
onCountryChange: (value) {}, onCountryChange: (value) {},
onChange: (String? value) {}, onChange: (String? value) {},

@ -85,8 +85,8 @@ class _RegisterNew extends State<RegisterNew> {
child: Column( child: Column(
children: [ children: [
CustomCountryDropdown( CustomCountryDropdown(
countryList: Country.values, countryList: CountryEnum.values,
onCountryChange: (Country? value) {}, onCountryChange: (CountryEnum? value) {},
isRtl: Directionality.of(context) == TextDirection.LTR, isRtl: Directionality.of(context) == TextDirection.LTR,
).withVerticalPadding(8.h), ).withVerticalPadding(8.h),
Divider(height: 1.h), Divider(height: 1.h),

@ -51,7 +51,9 @@ class _LandingPageState extends State<LandingPage> {
CustomButton( CustomButton(
text: LocaleKeys.loginOrRegister.tr(context: context), text: LocaleKeys.loginOrRegister.tr(context: context),
onPressed: () async { onPressed: () async {
await authenticationViewModel.selectDeviceImei();
// await authenticationViewModel.selectDeviceImei();
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => LoginScreen()));
}, },
backgroundColor: Color(0xffFEE9EA), backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA), borderColor: Color(0xffFEE9EA),

@ -40,7 +40,6 @@ class MedicalFilePage extends StatelessWidget {
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h), padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h),
leadingIcon: AppAssets.student_card, leadingIcon: AppAssets.student_card,
hasError: true,
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(

@ -17,7 +17,7 @@ class GenericBottomSheet extends StatefulWidget {
final List<Widget> buttons; final List<Widget> buttons;
TextEditingController? textController; TextEditingController? textController;
final bool isForEmail; final bool isForEmail;
Function(Country)? onCountryChange; Function(CountryEnum)? onCountryChange;
final bool isEnableCountryDropdown; final bool isEnableCountryDropdown;
final bool isFromSavedLogin; final bool isFromSavedLogin;
Function(String?)? onChange; Function(String?)? onChange;

@ -7,8 +7,8 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
class CustomCountryDropdown extends StatefulWidget { class CustomCountryDropdown extends StatefulWidget {
final List<Country> countryList; final List<CountryEnum> countryList;
final Function(Country)? onCountryChange; final Function(CountryEnum)? onCountryChange;
final bool isRtl; final bool isRtl;
const CustomCountryDropdown({ const CustomCountryDropdown({
@ -23,14 +23,14 @@ class CustomCountryDropdown extends StatefulWidget {
} }
class _CustomCountryDropdownState extends State<CustomCountryDropdown> { class _CustomCountryDropdownState extends State<CustomCountryDropdown> {
Country? selectedCountry; CountryEnum? selectedCountry;
late OverlayEntry _overlayEntry; late OverlayEntry _overlayEntry;
bool _isDropdownOpen = false; bool _isDropdownOpen = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
selectedCountry = Country.saudiArabia; selectedCountry = CountryEnum.saudiArabia;
} }
@override @override

Loading…
Cancel
Save