Merge remote-tracking branch 'origin/master' into feature/search_by_region

pull/42/head
taha.alam 1 month ago
commit 55c51f5742

@ -817,12 +817,14 @@
"news": "أخبار", "news": "أخبار",
"ready": "جاهز", "ready": "جاهز",
"enterValidNationalId": "الرجاء إدخال رقم الهوية الوطنية أو رقم الملف الصحيح", "enterValidNationalId": "الرجاء إدخال رقم الهوية الوطنية أو رقم الملف الصحيح",
"enterValidPhoneNumber": "الرجاء إدخال رقم هاتف صالح" "enterValidPhoneNumber": "الرجاء إدخال رقم هاتف صالح",
"medicalCentersWithCount": "{count} مراكز طبية", "medicalCentersWithCount": "{count} مراكز طبية",
"medicalCenters": "مراكز طبية", "medicalCenters": "مراكز طبية",
"hospitalsWithCount": "{count} مستشفيات", "hospitalsWithCount": "{count} مستشفيات",
"selectRegion": "اختر المنطقة", "selectRegion": "اختر المنطقة",
"selectFacility": "اختر المرافق", "selectFacility": "اختر المرافق",
"selectFacilitiesSubTitle": "يرجى اختيار المرفق للموعد", "selectFacilitiesSubTitle": "يرجى اختيار المرفق للموعد",
"selectHospitalSubTitle": "يرجى اختيار المستشفى للموعد" "selectHospitalSubTitle": "يرجى اختيار المستشفى للموعد",
"iAcceptThe" : "أوافق على",
"personalDetailsVerification": "التحقق من التفاصيل الشخصية",
} }

@ -819,6 +819,9 @@
"selectRegion": "Select Region", "selectRegion": "Select Region",
"selectFacility": "Select Facilities", "selectFacility": "Select Facilities",
"selectFacilitiesSubTitle": "Please select the facility for the appointment", "selectFacilitiesSubTitle": "Please select the facility for the appointment",
"selectHospitalSubTitle": "Please select the hospital for the appointment" "selectHospitalSubTitle": "Please select the hospital for the appointment",
"news": "News",
"iAcceptThe" : "I Accept the",
"personalDetailsVerification": "Personal Details Verification"
} }

@ -62,7 +62,7 @@ class AppState {
SelectDeviceByImeiRespModelElement? _selectDeviceByImeiRespModelElement; SelectDeviceByImeiRespModelElement? _selectDeviceByImeiRespModelElement;
void setSelectDeviceByImeiRespModelElement(SelectDeviceByImeiRespModelElement value) { void setSelectDeviceByImeiRespModelElement(SelectDeviceByImeiRespModelElement? value) {
_selectDeviceByImeiRespModelElement = value; _selectDeviceByImeiRespModelElement = value;
} }

@ -221,10 +221,15 @@ extension EmailValidator on String {
style: TextStyle(height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text( Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle(height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(
height: height ?? 23 / 26,
color: color ?? AppColors.blackColor,
fontSize: 26.fSize,
letterSpacing: letterSpacing ?? -1,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)),
); );
Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text( Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text(

@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:developer'; import 'dart:developer';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/services.dart' show rootBundle; import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -36,6 +37,7 @@ import 'package:hmg_patient_app_new/services/localauth_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/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/bottomsheet/exception_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/bottomsheet/exception_bottom_sheet.dart';
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
import 'models/request_models/get_user_mobile_device_data.dart'; import 'models/request_models/get_user_mobile_device_data.dart';
import 'models/request_models/insert_patient_mobile_deviceinfo.dart'; import 'models/request_models/insert_patient_mobile_deviceinfo.dart';
@ -48,6 +50,7 @@ class AuthenticationViewModel extends ChangeNotifier {
final DialogService _dialogService; final DialogService _dialogService;
final NavigationService _navigationService; final NavigationService _navigationService;
final LocalAuthService _localAuthService; final LocalAuthService _localAuthService;
AuthenticationViewModel({ AuthenticationViewModel({
required AppState appState, required AppState appState,
required AuthenticationRepo authenticationRepo, required AuthenticationRepo authenticationRepo,
@ -79,6 +82,8 @@ class AuthenticationViewModel extends ChangeNotifier {
CalenderEnum calenderType = CalenderEnum.gregorian; CalenderEnum calenderType = CalenderEnum.gregorian;
LoginTypeEnum loginTypeEnum = LoginTypeEnum.sms; LoginTypeEnum loginTypeEnum = LoginTypeEnum.sms;
final ValueNotifier<bool> otpScreenNotifier = ValueNotifier<bool>(false);
//================== //==================
String errorMsg = ''; String errorMsg = '';
@ -106,7 +111,6 @@ class AuthenticationViewModel extends ChangeNotifier {
} }
Future<void> clearDefaultInputValues() async { Future<void> clearDefaultInputValues() async {
nationalIdController.clear(); nationalIdController.clear();
phoneNumberController.clear(); phoneNumberController.clear();
emailController.clear(); emailController.clear();
@ -159,6 +163,10 @@ class AuthenticationViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
void clearEmailInput() {
emailController.text = "";
}
void onUAEUserCountrySelection(String? value) { void onUAEUserCountrySelection(String? value) {
pickedCountryByUAEUser = countriesList!.firstWhere((element) => element.name == value); pickedCountryByUAEUser = countriesList!.firstWhere((element) => element.name == value);
notifyListeners(); notifyListeners();
@ -355,7 +363,7 @@ class AuthenticationViewModel extends ChangeNotifier {
); );
// TODO: GET APP SMS SIGNATURE HERE // TODO: GET APP SMS SIGNATURE HERE
request.sMSSignature = "enKTDcqbOVd"; request.sMSSignature =await getSignature();
if (checkIsUserComingForRegister(request: payload)) { if (checkIsUserComingForRegister(request: payload)) {
_appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload);
@ -394,12 +402,8 @@ class AuthenticationViewModel extends ChangeNotifier {
return isUserComingForRegister; return isUserComingForRegister;
} }
Future<void> checkActivationCode({ Future<void> checkActivationCode(
required String? activationCode, {required String? activationCode, required OTPTypeEnum otpTypeEnum, required Function(String? message) onWrongActivationCode, Function()? onResendActivation}) async {
required OTPTypeEnum otpTypeEnum,
required Function(String? message) onWrongActivationCode,
Function()? onResendActivation,
}) async {
bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true || _appState.getUserRegistrationPayload.patientOutSa == 1); bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true || _appState.getUserRegistrationPayload.patientOutSa == 1);
final request = RequestUtils.getCommonRequestWelcome( final request = RequestUtils.getCommonRequestWelcome(
@ -422,6 +426,7 @@ class AuthenticationViewModel extends ChangeNotifier {
countryCode: _appState.getSelectDeviceByImeiRespModelElement != null && _appState.getSelectDeviceByImeiRespModelElement!.outSa == true countryCode: _appState.getSelectDeviceByImeiRespModelElement != null && _appState.getSelectDeviceByImeiRespModelElement!.outSa == true
? CountryEnum.unitedArabEmirates.countryCode ? CountryEnum.unitedArabEmirates.countryCode
: selectedCountrySignup.countryCode, : selectedCountrySignup.countryCode,
//TODO: Error Here IN Zip Code.
loginType: loginTypeEnum.toInt) loginType: loginTypeEnum.toInt)
.toJson(); .toJson();
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
@ -469,6 +474,7 @@ class AuthenticationViewModel extends ChangeNotifier {
failure: failure, failure: failure,
onUnHandledFailure: (failure) async { onUnHandledFailure: (failure) async {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
otpScreenNotifier.value = true;
await _dialogService.showCommonBottomSheetWithoutH(message: failure.message, label: LocaleKeys.notice.tr(), onOkPressed: () {}); await _dialogService.showCommonBottomSheetWithoutH(message: failure.message, label: LocaleKeys.notice.tr(), onOkPressed: () {});
}, },
onMessageStatusFailure: (failure) async { onMessageStatusFailure: (failure) async {
@ -595,6 +601,7 @@ class AuthenticationViewModel extends ChangeNotifier {
} }
Future<void> onWrongActivationCode({String? message}) async { Future<void> onWrongActivationCode({String? message}) async {
otpScreenNotifier.value = true;
await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {}); await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {});
} }
@ -622,19 +629,20 @@ class AuthenticationViewModel extends ChangeNotifier {
} }
checkLastLoginStatus(Function() onSuccess) async { checkLastLoginStatus(Function() onSuccess) async {
Future.delayed(Duration(seconds: 1), () async { Future.delayed(Duration(seconds: 1), () async {
if(cacheService.getBool(key: CacheConst.quickLoginEnabled) == null){ if (cacheService.getBool(key: CacheConst.quickLoginEnabled) == null) {
if (_appState.getSelectDeviceByImeiRespModelElement != null && if (_appState.getSelectDeviceByImeiRespModelElement != null &&
(_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) { (_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) {
phoneNumberController.text = phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
(_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") : _appState.getAuthenticatedUser()!.mobileNumber)!; ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
: _appState.getAuthenticatedUser()!.mobileNumber)!;
nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!; nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!;
onSuccess(); onSuccess();
} else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) && } else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) &&
_appState.getAuthenticatedUser() != null) { _appState.getAuthenticatedUser() != null) {
phoneNumberController.text = phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
(_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") : _appState.getAuthenticatedUser()!.mobileNumber)!; ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
: _appState.getAuthenticatedUser()!.mobileNumber)!;
nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!; nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!;
onSuccess(); onSuccess();
} }
@ -674,21 +682,27 @@ class AuthenticationViewModel extends ChangeNotifier {
} }
Future<void> onRegistrationComplete() async { Future<void> onRegistrationComplete() async {
LoaderBottomSheet.showLoader(); // LoaderBottomSheet.showLoader();
LoadingUtils.showFullScreenLoader(loadingText: "Setting up your medical file.\nMay take a moment.");
var request = RequestUtils.getUserSignupCompletionRequest(fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus); var request = RequestUtils.getUserSignupCompletionRequest(fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus);
final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request); final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request);
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async {
if (apiResponse.data is String) { if (apiResponse.data is String) {
//TODO: This Section Need to Be Testing. //TODO: This Section Need to Be Testing.
LoadingUtils.hideFullScreenLoader();
_dialogService.showExceptionBottomSheet(message: apiResponse.data, onOkPressed: () {}, onCancelPressed: () {}); _dialogService.showExceptionBottomSheet(message: apiResponse.data, onOkPressed: () {}, onCancelPressed: () {});
//TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result. //TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result.
} else { } else {
print(apiResponse.data as Map<String, dynamic>); LoadingUtils.hideFullScreenLoader();
if (apiResponse.data["MessageStatus"] == 1) { if (apiResponse.data["MessageStatus"] == 1) {
LoaderBottomSheet.hideLoader(); LoadingUtils.showFullScreenLoader(isSuccessDialog: true);
//TODO: Here We Need to Show a Dialog Of Something in the case of Success. //TODO: Here We Need to Show a Dialog Of Something in the case of Success.
await clearDefaultInputValues(); // This will Clear All Default Values Of User. await clearDefaultInputValues(); // This will Clear All Default Values Of User.
Future.delayed(Duration(seconds: 1), () {
LoadingUtils.hideFullScreenLoader();
_navigationService.pushAndReplace(AppRoutes.loginScreen); _navigationService.pushAndReplace(AppRoutes.loginScreen);
});
} }
} }
}); });
@ -736,6 +750,8 @@ class AuthenticationViewModel extends ChangeNotifier {
} else { } else {
//TODO: Here Hide Loader And Show TOAST //TODO: Here Hide Loader And Show TOAST
//TODO: if (response['ErrorCode'] == '-986') Toast With OK, And Show response as Output. //TODO: if (response['ErrorCode'] == '-986') Toast With OK, And Show response as Output.
LoaderBottomSheet.hideLoader();
_dialogService.showErrorBottomSheet(message: response['ErrorMessage']);
} }
} }
@ -921,4 +937,12 @@ class AuthenticationViewModel extends ChangeNotifier {
}, },
); );
} }
Future<String?> getSignature() async {
if (Platform.isAndroid) {
return await SmsVerification.getAppSignature();
} else {
return null;
}
}
} }

@ -7,8 +7,11 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.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/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart'; import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart';
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
import 'package:provider/provider.dart';
typedef OnDone = void Function(String text); typedef OnDone = void Function(String text);
@ -90,6 +93,7 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
int currentIndex = 0; int currentIndex = 0;
List<String> strList = []; List<String> strList = [];
bool hasFocus = false; bool hasFocus = false;
AuthenticationViewModel? authVm;
@override @override
void didUpdateWidget(OTPWidget oldWidget) { void didUpdateWidget(OTPWidget oldWidget) {
@ -124,6 +128,7 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
@override @override
void initState() { void initState() {
super.initState(); super.initState();
authVm = context.read<AuthenticationViewModel>();
focusNode = widget.focusNode ?? FocusNode(); focusNode = widget.focusNode ?? FocusNode();
_highlightAnimationController = AnimationController(vsync: this); _highlightAnimationController = AnimationController(vsync: this);
_initTextController(); _initTextController();
@ -132,12 +137,15 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
widget.controller!.addListener(_controllerListener); widget.controller!.addListener(_controllerListener);
} }
focusNode.addListener(_focusListener); focusNode.addListener(_focusListener);
authVm?.otpScreenNotifier.addListener(_onOtpScreenNotifierChanged);
} }
void _controllerListener() { void _controllerListener() {
if (mounted == true) { if (mounted == true) {
setState(() { setState(() {
_initTextController(); _initTextController();
text = widget.controller?.text ?? "";
currentIndex = text.length;
}); });
var onTextChanged = widget.onTextChanged; var onTextChanged = widget.onTextChanged;
if (onTextChanged != null) { if (onTextChanged != null) {
@ -154,6 +162,41 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
} }
} }
void onWrongOtpClear() {
if (mounted) {
setState(() {
text = "";
currentIndex = 0;
strList.clear();
_calculateStrList();
});
// Clear the controller if it exists
if (widget.controller != null) {
widget.controller!.clear();
}
// Remove focus from the input
if (focusNode.hasFocus) {
focusNode.unfocus();
}
// Optionally refocus after a short delay to allow user to re-enter OTP
Future.delayed(const Duration(milliseconds: 100), () {
if (mounted && widget.autoFocus) {
FocusScope.of(context).requestFocus(focusNode);
}
});
}
}
void _onOtpScreenNotifierChanged() {
if (authVm?.otpScreenNotifier.value == true) {
onWrongOtpClear();
authVm?.otpScreenNotifier.value = false;
}
}
void _initTextController() { void _initTextController() {
if (widget.controller == null) { if (widget.controller == null) {
return; return;
@ -304,19 +347,17 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
); );
} }
Widget _buildPinCode(int i, BuildContext context) { Widget _buildPinCode(int i, BuildContext context) {
Color pinBoxColor; Color pinBoxColor;
if (widget.hasError) { if (widget.hasError) {
pinBoxColor = widget.errorBorderColor; pinBoxColor = widget.errorBorderColor;
} else if (text.length == widget.maxLength) { } else if (text.length == widget.maxLength) {
// Check for completion first, before individual box logic
pinBoxColor = AppColors.successColor; pinBoxColor = AppColors.successColor;
} else if (i < text.length) { } else if (i < text.length) {
pinBoxColor = AppColors.blackBgColor; // Custom color for filled boxes pinBoxColor = AppColors.blackBgColor;
} else { } else {
pinBoxColor = widget.pinBoxColor; // Default white color pinBoxColor = widget.pinBoxColor;
} }
EdgeInsets insets; EdgeInsets insets;
@ -355,7 +396,6 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
); );
} }
// Widget _buildPinCode(int i, BuildContext context) { // Widget _buildPinCode(int i, BuildContext context) {
// Color pinBoxColor = widget.pinBoxColor; // Color pinBoxColor = widget.pinBoxColor;
// //
@ -455,13 +495,14 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
Timer? _resendTimer; Timer? _resendTimer;
int _resendTime = 120; int _resendTime = 120;
bool _isOtpComplete = false; bool _isOtpComplete = false;
bool _isVerifying = false; // Flag to prevent multiple verification calls bool _isVerifying = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_otpController = TextEditingController(); _otpController = TextEditingController();
_startResendTimer(); _startResendTimer();
checkSignature();
} }
@override @override
@ -495,6 +536,30 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
} }
} }
void checkSignature() async {
SmsVerification.startListeningSms().then((message) {
final intRegex = RegExp(r'\d+', multiLine: true);
var otp = SmsVerification.getCode(message, intRegex);
if (otp != null && otp.length == _otpLength) {
autoFillOtp(otp); // Use autoFillOtp to update controller and UI
}
SmsVerification.stopListening();
});
}
void _onAutoOtpChanged(String value) {
setState(() {
_isOtpComplete = value.length == _otpLength;
});
if (_isOtpComplete && !_isVerifying) {
_isVerifying = true;
_verifyOtp(value);
} else if (!_isOtpComplete) {
_isVerifying = false;
}
}
void _resendOtp() { void _resendOtp() {
if (_resendTime == 0) { if (_resendTime == 0) {
setState(() { setState(() {
@ -504,7 +569,6 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
}); });
_otpController.clear(); _otpController.clear();
_startResendTimer(); _startResendTimer();
// autoFillOtp("1234");
widget.onResendOTPPressed(widget.phoneNumber); widget.onResendOTPPressed(widget.phoneNumber);
} }
} }
@ -618,5 +682,7 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
if (otp.length != _otpLength) return; if (otp.length != _otpLength) return;
_isVerifying = false; _isVerifying = false;
_otpController.text = otp; _otpController.text = otp;
setState(() {});
_onOtpChanged(otp); // Ensure verification and color update
} }
} }

@ -9,7 +9,7 @@ import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patien
import 'package:hmg_patient_app_new/services/logger_service.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class InsuranceRepo { abstract class InsuranceRepo {
Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails({required String patientId}); Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails();
Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory({required String patientId}); Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory({required String patientId});
@ -23,7 +23,7 @@ class InsuranceRepoImp implements InsuranceRepo {
InsuranceRepoImp({required this.loggerService, required this.apiClient}); InsuranceRepoImp({required this.loggerService, required this.apiClient});
@override @override
Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails({required String patientId}) async { Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails() async {
Map<String, dynamic> mapDevice = {}; Map<String, dynamic> mapDevice = {};
try { try {

@ -49,10 +49,13 @@ class InsuranceViewModel extends ChangeNotifier {
} }
Future<void> getPatientInsuranceDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientInsuranceDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await insuranceRepo.getPatientInsuranceDetails(patientId: "1231755"); final result = await insuranceRepo.getPatientInsuranceDetails();
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
isInsuranceLoading = false;
},
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});

@ -91,13 +91,13 @@ class MedicalFileRepoImp implements MedicalFileRepo {
// throw Exception("lab list is empty"); // throw Exception("lab list is empty");
// } // }
final vaccinesList = list.map((item) => PatientSickLeavesResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientSickLeavesResponseModel>(); final sickLeavesList = list.map((item) => PatientSickLeavesResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientSickLeavesResponseModel>();
apiResponse = GenericApiModel<List<PatientSickLeavesResponseModel>>( apiResponse = GenericApiModel<List<PatientSickLeavesResponseModel>>(
messageStatus: messageStatus, messageStatus: messageStatus,
statusCode: statusCode, statusCode: statusCode,
errorMessage: null, errorMessage: null,
data: vaccinesList, data: sickLeavesList,
); );
} catch (e) { } catch (e) {
failure = DataParsingFailure(e.toString()); failure = DataParsingFailure(e.toString());

@ -14,7 +14,7 @@ class PatientSickLeavesResponseModel {
num? actualDoctorRate; num? actualDoctorRate;
String? appointmentDate; String? appointmentDate;
String? clinicName; String? clinicName;
double? decimalDoctorRate; num? decimalDoctorRate;
String? doctorImageURL; String? doctorImageURL;
String? doctorName; String? doctorName;
num? doctorRate; num? doctorRate;
@ -32,7 +32,7 @@ class PatientSickLeavesResponseModel {
String? isInOutPatientDescriptionN; String? isInOutPatientDescriptionN;
bool? isLiveCareAppointment; bool? isLiveCareAppointment;
dynamic medicalDirectorApprovedStatus; dynamic medicalDirectorApprovedStatus;
int? noOfPatientsRate; num? noOfPatientsRate;
dynamic patientName; dynamic patientName;
String? projectName; String? projectName;
String? qR; String? qR;

@ -1,19 +1,12 @@
import 'package:flutter/material.dart'; 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/cache_consts.dart' show CacheConst;
import 'package:hmg_patient_app_new/core/utils/utils.dart' show Utils;
import 'package:hmg_patient_app_new/features/my_appointments/models/facility_selection.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/doctor_list_api_response.dart'
show RegionList, PatientDoctorAppointmentListByRegion;
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import 'package:location/location.dart' show Location;
import '../../core/utils/doctor_response_mapper.dart' show DoctorMapper; import '../../core/utils/doctor_response_mapper.dart' show DoctorMapper;
class MyAppointmentsViewModel extends ChangeNotifier { class MyAppointmentsViewModel extends ChangeNotifier {
int selectedTabIndex = 0; int selectedTabIndex = 0;
@ -26,30 +19,24 @@ class MyAppointmentsViewModel extends ChangeNotifier {
bool isTimeLineAppointmentsLoading = false; bool isTimeLineAppointmentsLoading = false;
bool isPatientMyDoctorsLoading = false; bool isPatientMyDoctorsLoading = false;
List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = [];
[];
List<PatientAppointmentHistoryResponseModel> List<PatientAppointmentHistoryResponseModel> patientUpcomingAppointmentsHistoryList = [];
patientUpcomingAppointmentsHistoryList = []; List<PatientAppointmentHistoryResponseModel> patientArrivedAppointmentsHistoryList = [];
List<PatientAppointmentHistoryResponseModel>
patientArrivedAppointmentsHistoryList = [];
List<PatientAppointmentHistoryResponseModel> patientTimelineAppointmentsList = List<PatientAppointmentHistoryResponseModel> patientTimelineAppointmentsList = [];
[];
List<PatientAppointmentHistoryResponseModel> patientMyDoctorsList = []; List<PatientAppointmentHistoryResponseModel> patientMyDoctorsList = [];
PatientAppointmentShareResponseModel? patientAppointmentShareResponseModel; PatientAppointmentShareResponseModel? patientAppointmentShareResponseModel;
MyAppointmentsViewModel( MyAppointmentsViewModel({required this.myAppointmentsRepo, required this.errorHandlerService, required this.appState});
{required this.myAppointmentsRepo, required this.errorHandlerService,required this.appState});
void onTabChange(int index) { void onTabChange(int index) {
selectedTabIndex = index; selectedTabIndex = index;
notifyListeners(); notifyListeners();
} }
initAppointmentsViewModel() { initAppointmentsViewModel() {
patientAppointmentsHistoryList.clear(); patientAppointmentsHistoryList.clear();
patientUpcomingAppointmentsHistoryList.clear(); patientUpcomingAppointmentsHistoryList.clear();
@ -83,8 +70,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
setAppointmentReminder( setAppointmentReminder(bool value, PatientAppointmentHistoryResponseModel item) {
bool value, PatientAppointmentHistoryResponseModel item) {
int index = patientAppointmentsHistoryList.indexOf(item); int index = patientAppointmentsHistoryList.indexOf(item);
if (index != -1) { if (index != -1) {
patientAppointmentsHistoryList[index].hasReminder = value; patientAppointmentsHistoryList[index].hasReminder = value;
@ -92,18 +78,12 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
} }
Future<void> getPatientAppointments( Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
bool isActiveAppointment, bool isArrivedAppointments, final result = await myAppointmentsRepo.getPatientAppointments(isActiveAppointment: isActiveAppointment, isArrivedAppointments: isArrivedAppointments);
{Function(dynamic)? onSuccess, Function(String)? onError}) async { final resultArrived = await myAppointmentsRepo.getPatientAppointments(isActiveAppointment: false, isArrivedAppointments: true);
final result = await myAppointmentsRepo.getPatientAppointments(
isActiveAppointment: isActiveAppointment,
isArrivedAppointments: isArrivedAppointments);
final resultArrived = await myAppointmentsRepo.getPatientAppointments(
isActiveAppointment: false, isArrivedAppointments: true);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -119,8 +99,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
resultArrived.fold( resultArrived.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -135,27 +114,19 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}, },
); );
patientAppointmentsHistoryList patientAppointmentsHistoryList.addAll(patientUpcomingAppointmentsHistoryList);
.addAll(patientUpcomingAppointmentsHistoryList); patientAppointmentsHistoryList.addAll(patientArrivedAppointmentsHistoryList);
patientAppointmentsHistoryList
.addAll(patientArrivedAppointmentsHistoryList);
print( print('Upcoming Appointments: ${patientUpcomingAppointmentsHistoryList.length}');
'Upcoming Appointments: ${patientUpcomingAppointmentsHistoryList.length}'); print('Arrived Appointments: ${patientArrivedAppointmentsHistoryList.length}');
print(
'Arrived Appointments: ${patientArrivedAppointmentsHistoryList.length}');
print('All Appointments: ${patientAppointmentsHistoryList.length}'); print('All Appointments: ${patientAppointmentsHistoryList.length}');
} }
Future<void> getPatientShareAppointment( Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
int projectID, int clinicID, String appointmentNo, final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo);
{Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientShareAppointment(
projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -172,19 +143,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> addAdvanceNumberRequest( Future<void> addAdvanceNumberRequest(
{required String advanceNumber, {required String advanceNumber, required String paymentReference, required String appointmentNo, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required String paymentReference, final result = await myAppointmentsRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference, appointmentNo: appointmentNo);
required String appointmentNo,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await myAppointmentsRepo.addAdvanceNumberRequest(
advanceNumber: advanceNumber,
paymentReference: paymentReference,
appointmentNo: appointmentNo);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -199,21 +162,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> generateAppointmentQR( Future<void> generateAppointmentQR(
{required int clinicID, {required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required int projectID, final result = await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
required String appointmentNo,
required int isFollowUp,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await myAppointmentsRepo.generateAppointmentQR(
clinicID: clinicID,
projectID: projectID,
appointmentNo: appointmentNo,
isFollowUp: isFollowUp);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -227,18 +180,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> cancelAppointment( Future<void> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
{required PatientAppointmentHistoryResponseModel final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
patientAppointmentHistoryResponseModel,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await myAppointmentsRepo.cancelAppointment(
patientAppointmentHistoryResponseModel:
patientAppointmentHistoryResponseModel);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!); onError!(apiResponse.errorMessage!);
@ -253,18 +199,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> confirmAppointment( Future<void> confirmAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
{required PatientAppointmentHistoryResponseModel final result = await myAppointmentsRepo.confirmAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
patientAppointmentHistoryResponseModel,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await myAppointmentsRepo.confirmAppointment(
patientAppointmentHistoryResponseModel:
patientAppointmentHistoryResponseModel);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!); onError!(apiResponse.errorMessage!);
@ -301,8 +240,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
patientType: patientType); patientType: patientType);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
@ -317,21 +255,15 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> sendCheckInNfcRequest( Future<void> sendCheckInNfcRequest(
{required PatientAppointmentHistoryResponseModel {required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel,
patientAppointmentHistoryResponseModel,
required String scannedCode, required String scannedCode,
required int checkInType, required int checkInType,
Function(dynamic)? onSuccess, Function(dynamic)? onSuccess,
Function(String)? onError}) async { Function(String)? onError}) async {
final result = await myAppointmentsRepo.sendCheckInNfcRequest( final result = await myAppointmentsRepo.sendCheckInNfcRequest(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, scannedCode: scannedCode, checkInType: checkInType);
patientAppointmentHistoryResponseModel:
patientAppointmentHistoryResponseModel,
scannedCode: scannedCode,
checkInType: checkInType);
result.fold( result.fold(
(failure) async => (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!); onError!(apiResponse.errorMessage!);
@ -346,13 +278,14 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> getPatientMyDoctors( Future<void> getPatientMyDoctors({Function(dynamic)? onSuccess, Function(String)? onError}) async {
{Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientDoctorsList(); final result = await myAppointmentsRepo.getPatientDoctorsList();
result.fold( result.fold(
(failure) async => // (failure) async => await errorHandlerService.handleError(failure: failure),
await errorHandlerService.handleError(failure: failure), (failure) async {
isPatientMyDoctorsLoading = false;
},
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});

@ -68,7 +68,10 @@ class PrescriptionsViewModel extends ChangeNotifier {
final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755"); final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755");
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
isPrescriptionsOrdersLoading = false;
},
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});

@ -812,6 +812,7 @@ abstract class LocaleKeys {
static const notNow = 'notNow'; static const notNow = 'notNow';
static const pendingActivation = 'pendingActivation'; static const pendingActivation = 'pendingActivation';
static const awaitingApproval = 'awaitingApproval'; static const awaitingApproval = 'awaitingApproval';
static const news = 'news';
static const ready = 'ready'; static const ready = 'ready';
static const enterValidNationalId = 'enterValidNationalId'; static const enterValidNationalId = 'enterValidNationalId';
static const enterValidPhoneNumber = 'enterValidPhoneNumber'; static const enterValidPhoneNumber = 'enterValidPhoneNumber';
@ -822,6 +823,7 @@ abstract class LocaleKeys {
static const selectFacility = 'selectFacility'; static const selectFacility = 'selectFacility';
static const selectFacilitiesSubTitle = 'selectFacilitiesSubTitle'; static const selectFacilitiesSubTitle = 'selectFacilitiesSubTitle';
static const selectHospitalSubTitle = 'selectHospitalSubTitle'; static const selectHospitalSubTitle = 'selectHospitalSubTitle';
static const iAcceptThe = 'iAcceptThe';
static const personalDetailsVerification = 'personalDetailsVerification';
static const news = 'news';
} }

@ -4,6 +4,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.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/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
@ -153,6 +155,7 @@ class LoginScreenState extends State<LoginScreen> {
required TextEditingController? phoneNumberController, required TextEditingController? phoneNumberController,
required AuthenticationViewModel authViewModel, required AuthenticationViewModel authViewModel,
}) { }) {
AppState appState = getIt<AppState>();
context.showBottomSheet( context.showBottomSheet(
isScrollControlled: true, isScrollControlled: true,
isDismissible: false, isDismissible: false,
@ -180,6 +183,8 @@ class LoginScreenState extends State<LoginScreen> {
onOkPress: () { onOkPress: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
})) { })) {
Navigator.of(context).pop();
appState.setSelectDeviceByImeiRespModelElement(null);
await authViewModel.checkUserAuthentication(otpTypeEnum: OTPTypeEnum.sms); await authViewModel.checkUserAuthentication(otpTypeEnum: OTPTypeEnum.sms);
} }
}, },
@ -209,6 +214,8 @@ class LoginScreenState extends State<LoginScreen> {
onOkPress: () { onOkPress: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
})) { })) {
Navigator.of(context).pop();
appState.setSelectDeviceByImeiRespModelElement(null);
await authViewModel.checkUserAuthentication(otpTypeEnum: OTPTypeEnum.whatsapp); await authViewModel.checkUserAuthentication(otpTypeEnum: OTPTypeEnum.whatsapp);
} }
}, },

@ -2,6 +2,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.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/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
@ -152,14 +154,38 @@ class _RegisterNew extends State<RegisterNew> {
}, },
), ),
SizedBox(width: 12.h), SizedBox(width: 12.h),
Expanded( Row(
child: Text( children: [
LocaleKeys.iAcceptTermsConditions.tr(), Text(
LocaleKeys.iAcceptThe.tr(),
style: context.dynamicTextStyle(fontSize: 14.fSize, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)), style: context.dynamicTextStyle(fontSize: 14.fSize, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)),
), ),
GestureDetector(
onTap: () {
// Navigate to terms and conditions page
Navigator.of(context).pushNamed('/terms');
},
child: Text(
LocaleKeys.termsConditoins.tr(),
style: context.dynamicTextStyle(
fontSize: 14.fSize,
fontWeight: FontWeight.w500,
color: AppColors.primaryRedColor,
decoration: TextDecoration.underline,
decorationColor: AppColors.primaryRedBorderColor,
),
),
), ),
], ],
), ),
// Expanded(
// child: Text(
// LocaleKeys.iAcceptTermsConditions.tr().split("the").first,
// style: context.dynamicTextStyle(fontSize: 14.fSize, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)),
// ),
// ),
],
),
), ),
SizedBox(height: 25.h), SizedBox(height: 25.h),
CustomButton( CustomButton(
@ -224,6 +250,7 @@ class _RegisterNew extends State<RegisterNew> {
} }
void showRegisterModel({required BuildContext context, required AuthenticationViewModel authVM}) { void showRegisterModel({required BuildContext context, required AuthenticationViewModel authVM}) {
AppState appState = getIt.get<AppState>();
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
@ -235,7 +262,7 @@ class _RegisterNew extends State<RegisterNew> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: GenericBottomSheet( child: GenericBottomSheet(
countryCode: authVM.selectedCountrySignup.countryCode, countryCode: authVM.selectedCountrySignup.countryCode,
initialPhoneNumber: "", initialPhoneNumber: authVM.phoneNumberController.text,
textController: authVM.phoneNumberController, textController: authVM.phoneNumberController,
isEnableCountryDropdown: false, isEnableCountryDropdown: false,
onCountryChange: authVM.onCountryChange, onCountryChange: authVM.onCountryChange,
@ -256,6 +283,7 @@ class _RegisterNew extends State<RegisterNew> {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
)) { )) {
appState.setSelectDeviceByImeiRespModelElement(null);
await authVM.onRegistrationStart(otpTypeEnum: OTPTypeEnum.sms); await authVM.onRegistrationStart(otpTypeEnum: OTPTypeEnum.sms);
} }
}, },
@ -280,15 +308,14 @@ class _RegisterNew extends State<RegisterNew> {
child: CustomButton( child: CustomButton(
text: LocaleKeys.sendOTPWHATSAPP.tr(), text: LocaleKeys.sendOTPWHATSAPP.tr(),
onPressed: () async { onPressed: () async {
// Dismiss keyboard before validation
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
if (ValidationUtils.isValidatePhone( if (ValidationUtils.isValidatePhone(
phoneNumber: authVM.phoneNumberController.text, phoneNumber: authVM.phoneNumberController.text,
onOkPress: () { onOkPress: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
)) { )) {
appState.setSelectDeviceByImeiRespModelElement(null);
await authVM.onRegistrationStart(otpTypeEnum: OTPTypeEnum.whatsapp); await authVM.onRegistrationStart(otpTypeEnum: OTPTypeEnum.whatsapp);
} }
}, },
@ -296,6 +323,7 @@ class _RegisterNew extends State<RegisterNew> {
borderColor: AppColors.borderOnlyColor, borderColor: AppColors.borderOnlyColor,
textColor: AppColors.textColor, textColor: AppColors.textColor,
icon: AppAssets.whatsapp, icon: AppAssets.whatsapp,
iconColor: null,
), ),
), ),
], ],

@ -44,20 +44,24 @@ class _RegisterNew extends State<RegisterNewStep2> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>(); AppState appState = getIt.get<AppState>();
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
appBar: CustomAppBar( appBar: CustomAppBar(
onBackPressed: () { onBackPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
// authVM!.clearDefaultInputValues(); // authVM!.clearDefaultInputValues();
authVM!.clearEmailInput();
}, },
onLanguageChanged: (lang) {}, onLanguageChanged: (lang) {},
hideLogoAndLang: true, hideLogoAndLang: true,
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
reverse: false, reverse: false,
padding: EdgeInsets.only(left: 24.h, right: 24.h, top: 24.h), padding: EdgeInsets.only(left: 24.h, right: 24.h, top: 0.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
LocaleKeys.personalDetailsVerification.tr().toText26(color: AppColors.textColor, weight: FontWeight.w600, letterSpacing: -2),
SizedBox(height: 24.h),
Directionality( Directionality(
textDirection: Directionality.of(context), textDirection: Directionality.of(context),
child: Container( child: Container(
@ -67,7 +71,8 @@ class _RegisterNew extends State<RegisterNewStep2> {
children: [ children: [
TextInputWidget( TextInputWidget(
labelText: authVM!.isUserFromUAE() ? LocaleKeys.fullName.tr() : LocaleKeys.name.tr(), labelText: authVM!.isUserFromUAE() ? LocaleKeys.fullName.tr() : LocaleKeys.name.tr(),
hintText: authVM!.isUserFromUAE() ? LocaleKeys.enterNameHere.tr() : ("${appState.getNHICUserData.firstNameEn!.toUpperCase()} ${appState.getNHICUserData.lastNameEn!.toUpperCase()}"), hintText:
authVM!.isUserFromUAE() ? LocaleKeys.enterNameHere.tr() : ("${appState.getNHICUserData.firstNameEn!.toUpperCase()} ${appState.getNHICUserData.lastNameEn!.toUpperCase()}"),
controller: authVM!.isUserFromUAE() ? authVM!.nameController : null, controller: authVM!.isUserFromUAE() ? authVM!.nameController : null,
isEnable: true, isEnable: true,
prefix: null, prefix: null,
@ -76,8 +81,9 @@ class _RegisterNew extends State<RegisterNewStep2> {
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: authVM!.isUserFromUAE() ? false : true, isReadOnly: authVM!.isUserFromUAE() ? false : true,
leadingIcon: AppAssets.user_circle) leadingIcon: AppAssets.user_circle,
.paddingSymmetrical(0.h, 16.h), labelColor: AppColors.textColor,
).paddingSymmetrical(0.h, 16.h),
Divider(height: 1, color: AppColors.greyColor), Divider(height: 1, color: AppColors.greyColor),
TextInputWidget( TextInputWidget(
labelText: LocaleKeys.nationalIdNumber.tr(), labelText: LocaleKeys.nationalIdNumber.tr(),
@ -89,6 +95,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.student_card) leadingIcon: AppAssets.student_card)
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
Divider(height: 1, color: AppColors.greyColor), Divider(height: 1, color: AppColors.greyColor),
@ -108,6 +115,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
isAllowRadius: false, isAllowRadius: false,
labelColor: AppColors.textColor,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: AppAssets.arrow_down, selectionCustomIcon: AppAssets.arrow_down,
leadingIcon: AppAssets.user_full, leadingIcon: AppAssets.user_full,
@ -124,6 +132,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: authVM!.isUserFromUAE() ? false : true, isReadOnly: authVM!.isUserFromUAE() ? false : true,
leadingIcon: AppAssets.user_full, leadingIcon: AppAssets.user_full,
labelColor: AppColors.textColor,
onChange: (value) {}) onChange: (value) {})
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
Divider(height: 1, color: AppColors.greyColor), Divider(height: 1, color: AppColors.greyColor),
@ -143,6 +152,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
isAllowRadius: false, isAllowRadius: false,
labelColor: AppColors.textColor,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: AppAssets.arrow_down, selectionCustomIcon: AppAssets.arrow_down,
leadingIcon: AppAssets.smart_phone, leadingIcon: AppAssets.smart_phone,
@ -160,6 +170,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.smart_phone, leadingIcon: AppAssets.smart_phone,
onChange: (value) {}) onChange: (value) {})
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
@ -190,6 +201,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
onChange: authVM.onUAEUserCountrySelection, onChange: authVM.onUAEUserCountrySelection,
isBorderAllowed: false, isBorderAllowed: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
labelColor: AppColors.textColor,
isAllowRadius: false, isAllowRadius: false,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: AppAssets.arrow_down, selectionCustomIcon: AppAssets.arrow_down,
@ -208,6 +220,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.globe, leadingIcon: AppAssets.globe,
onChange: (value) {}) onChange: (value) {})
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
@ -224,6 +237,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isAllowRadius: false, isAllowRadius: false,
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
labelColor: AppColors.textColor,
isReadOnly: true, isReadOnly: true,
leadingIcon: AppAssets.call) leadingIcon: AppAssets.call)
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
@ -240,6 +254,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.birthday_cake, leadingIcon: AppAssets.birthday_cake,
selectionType: null, selectionType: null,
).paddingSymmetrical(0.h, 16.h), ).paddingSymmetrical(0.h, 16.h),
@ -269,12 +284,12 @@ class _RegisterNew extends State<RegisterNewStep2> {
), ),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
backgroundColor: AppColors.lightGreenColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.lightGreenColor, borderColor: AppColors.primaryRedColor,
textColor: AppColors.textGreenColor, textColor: AppColors.whiteColor,
text: LocaleKeys.confirm.tr(), text: LocaleKeys.confirm.tr(),
icon: AppAssets.confirm, icon: AppAssets.confirm,
iconColor: AppColors.textGreenColor, iconColor: AppColors.whiteColor,
onPressed: () { onPressed: () {
if (appState.getUserRegistrationPayload.zipCode != CountryEnum.saudiArabia.countryCode) { if (appState.getUserRegistrationPayload.zipCode != CountryEnum.saudiArabia.countryCode) {
if (ValidationUtils.validateUaeRegistration( if (ValidationUtils.validateUaeRegistration(

@ -12,6 +12,8 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.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/login.dart'; import 'package:hmg_patient_app_new/presentation/authentication/login.dart';
import 'package:hmg_patient_app_new/presentation/home/landing_page.dart';
import 'package:hmg_patient_app_new/presentation/home/navigation_screen.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/appbar/app_bar_widget.dart'; 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';
@ -171,10 +173,9 @@ class _SavedLogin extends State<SavedLogin> {
authVm.checkUserAuthentication(otpTypeEnum: OTPTypeEnum.sms); authVm.checkUserAuthentication(otpTypeEnum: OTPTypeEnum.sms);
}, },
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedBorderColor, borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
icon: AppAssets.sms, icon: AppAssets.sms),
),
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -247,13 +248,13 @@ class _SavedLogin extends State<SavedLogin> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: Container( child: SizedBox(
height: 56, height: 56,
child: CustomButton( child: CustomButton(
text: LocaleKeys.guest.tr(), text: LocaleKeys.guest.tr(),
onPressed: () { onPressed: () {
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (BuildContext context) => LoginScreen()), MaterialPageRoute(builder: (BuildContext context) => LandingNavigation()),
); );
}, },
backgroundColor: Color(0xffFEE9EA), backgroundColor: Color(0xffFEE9EA),
@ -277,7 +278,7 @@ class _SavedLogin extends State<SavedLogin> {
text: LocaleKeys.switchAccount.tr(), text: LocaleKeys.switchAccount.tr(),
onPressed: () async { onPressed: () async {
await authVm.clearDefaultInputValues(); await authVm.clearDefaultInputValues();
Navigator.of(context).pushReplacement( Navigator.of(context).push(
MaterialPageRoute(builder: (BuildContext context) => LoginScreen()), MaterialPageRoute(builder: (BuildContext context) => LoginScreen()),
); );
}, },

@ -70,6 +70,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
insuranceViewModel.initInsuranceProvider(); insuranceViewModel.initInsuranceProvider();
medicalFileViewModel.setIsPatientSickLeaveListLoading(true); medicalFileViewModel.setIsPatientSickLeaveListLoading(true);
medicalFileViewModel.getPatientSickLeaveList(); medicalFileViewModel.getPatientSickLeaveList();
medicalFileViewModel.onTabChanged(0);
} }
}); });
super.initState(); super.initState();
@ -647,9 +648,14 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) { Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
return insuranceVM.isInsuranceLoading return insuranceVM.isInsuranceLoading
? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.0) ? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.0)
: PatientInsuranceCard( : insuranceVM.patientInsuranceList.isNotEmpty
? PatientInsuranceCard(
insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first, insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first,
isInsuranceExpired: DateTime.now().isAfter(DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo))); isInsuranceExpired: DateTime.now().isAfter(
DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo),
),
)
: SizedBox.shrink();
}), }),
SizedBox(height: 10.h), SizedBox(height: 10.h),
GridView( GridView(

@ -22,19 +22,9 @@ class NavigationService {
navigatorKey.currentState?.pushReplacementNamed(routeName); navigatorKey.currentState?.pushReplacementNamed(routeName);
} }
Future<T?> pushToOtpScreen<T>({ Future<T?> pushToOtpScreen<T>({required String phoneNumber, required Function(int code) checkActivationCode, required Function(String phoneNumber) onResendOTPPressed}) {
required String phoneNumber,
required Function(int code) checkActivationCode,
required Function(String phoneNumber) onResendOTPPressed,
}) {
return navigatorKey.currentState!.push( return navigatorKey.currentState!.push(
MaterialPageRoute( MaterialPageRoute(builder: (_) => OTPVerificationScreen(phoneNumber: phoneNumber, checkActivationCode: checkActivationCode, onResendOTPPressed: onResendOTPPressed)),
builder: (_) => OTPVerificationScreen(
phoneNumber: phoneNumber,
checkActivationCode: checkActivationCode,
onResendOTPPressed: onResendOTPPressed,
),
),
); );
} }

@ -18,9 +18,10 @@ class DropdownWidget extends StatelessWidget {
final bool hasSelectionCustomIcon; final bool hasSelectionCustomIcon;
final String? selectionCustomIcon; final String? selectionCustomIcon;
final String? leadingIcon; final String? leadingIcon;
final Color? labelColor;
const DropdownWidget({ const DropdownWidget(
Key? key, {Key? key,
required this.labelText, required this.labelText,
required this.hintText, required this.hintText,
required this.dropdownItems, required this.dropdownItems,
@ -33,14 +34,15 @@ class DropdownWidget extends StatelessWidget {
this.hasSelectionCustomIcon = false, this.hasSelectionCustomIcon = false,
this.selectionCustomIcon, this.selectionCustomIcon,
this.leadingIcon, this.leadingIcon,
}) : super(key: key); this.labelColor})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget content = Column( Widget content = Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [_buildLabelText(), _buildDropdown(context)], children: [_buildLabelText(labelColor), _buildDropdown(context)],
); );
return Container( return Container(
@ -75,13 +77,13 @@ class DropdownWidget extends StatelessWidget {
child: Utils.buildSvgWithAssets(icon: leadingIcon!)); child: Utils.buildSvgWithAssets(icon: leadingIcon!));
} }
Widget _buildLabelText() { Widget _buildLabelText(Color? labelColor) {
return Text( return Text(
labelText, labelText,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.fSize,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xff898A8D), color: labelColor ?? Color(0xff898A8D),
letterSpacing: -0.2, letterSpacing: -0.2,
height: 18 / 12, height: 18 / 12,
), ),

@ -41,12 +41,13 @@ class TextInputWidget extends StatelessWidget {
final num? fontSize; final num? fontSize;
final bool? isWalletAmountInput; final bool? isWalletAmountInput;
final Widget? suffix; final Widget? suffix;
final Color? labelColor;
// final List<Country> countryList; // final List<Country> countryList;
// final Function(Country)? onCountryChange; // final Function(Country)? onCountryChange;
TextInputWidget({ TextInputWidget(
super.key, {super.key,
required this.labelText, required this.labelText,
required this.hintText, required this.hintText,
this.controller, this.controller,
@ -71,6 +72,7 @@ class TextInputWidget extends StatelessWidget {
this.fontSize = 14, this.fontSize = 14,
this.isWalletAmountInput = false, this.isWalletAmountInput = false,
this.suffix, this.suffix,
this.labelColor
// this.countryList = const [], // this.countryList = const [],
// this.onCountryChange, // this.onCountryChange,
}); });
@ -135,7 +137,7 @@ class TextInputWidget extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
_buildLabelText().paddingOnly(right: (appState.getLanguageCode() == "ar" ? 10 : 0)), _buildLabelText(labelColor).paddingOnly(right: (appState.getLanguageCode() == "ar" ? 10 : 0)),
_buildTextField(context), _buildTextField(context),
], ],
), ),
@ -206,13 +208,13 @@ class TextInputWidget extends StatelessWidget {
); );
} }
Widget _buildLabelText() { Widget _buildLabelText(Color? labelColor) {
return Text( return Text(
labelText, labelText,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.fSize,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.inputLabelTextColor, color: labelColor ?? AppColors.inputLabelTextColor,
letterSpacing: -0.2, letterSpacing: -0.2,
height: 18 / 12, height: 18 / 12,
), ),

@ -66,6 +66,7 @@ dependencies:
firebase_analytics: ^11.5.1 firebase_analytics: ^11.5.1
jiffy: ^6.4.3 jiffy: ^6.4.3
hijri_gregorian_calendar: ^0.1.1 hijri_gregorian_calendar: ^0.1.1
sms_otp_auto_verify: ^2.2.0
web: any web: any
flutter_staggered_animations: ^1.1.1 flutter_staggered_animations: ^1.1.1

Loading…
Cancel
Save