diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index a2912a0..2acd5e3 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -807,6 +807,7 @@ "locationServicesRequiredForAttendance": "يجب تفعيل خدمة الموقع لتسجيل الحضور", "pleaseProvideLocationPermission": "الرجاء منح إذن الموقع", "microphoneAccessRequired": "يحتاج التطبيق إلى إذن الوصول إلى الميكروفون لتسجيل الصوت.", - "shareAccessGuide": "مشاركة دليل الوصول" + "shareAccessGuide": "مشاركة دليل الوصول", + "nationalIdOrIqamaNumber": "رقم الهوية الوطنية أو الإقامة" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 33cf246..89eb9ff 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -807,7 +807,8 @@ "locationServicesRequiredForAttendance": "You need to enable location services to mark attendance", "pleaseProvideLocationPermission": "Please provide location permission", "microphoneAccessRequired": "The app needs microphone access to be able to record audio.", - "shareAccessGuide": "Share Access Guide" + "shareAccessGuide": "Share Access Guide", + "nationalIdOrIqamaNumber": "National ID or Iqama Number" } diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index a12943a..efd27f9 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -819,7 +819,8 @@ class CodegenLoader extends AssetLoader{ "locationServicesRequiredForAttendance": "يجب تفعيل خدمة الموقع لتسجيل الحضور", "pleaseProvideLocationPermission": "الرجاء منح إذن الموقع", "microphoneAccessRequired": "يحتاج التطبيق إلى إذن الوصول إلى الميكروفون لتسجيل الصوت.", - "shareAccessGuide": "مشاركة دليل الوصول" + "shareAccessGuide": "مشاركة دليل الوصول", + "nationalIdOrIqamaNumber": "رقم الهوية الوطنية أو الإقامة" }; static const Map _en_US = { "mohemm": "Mohemm", @@ -1626,7 +1627,8 @@ static const Map _en_US = { "locationServicesRequiredForAttendance": "You need to enable location services to mark attendance", "pleaseProvideLocationPermission": "Please provide location permission", "microphoneAccessRequired": "The app needs microphone access to be able to record audio.", - "shareAccessGuide": "Share Access Guide" + "shareAccessGuide": "Share Access Guide", + "nationalIdOrIqamaNumber": "National ID or Iqama Number" }; static const Map> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 07d0587..6ee8472 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -792,5 +792,6 @@ abstract class LocaleKeys { static const pleaseProvideLocationPermission = 'pleaseProvideLocationPermission'; static const microphoneAccessRequired = 'microphoneAccessRequired'; static const shareAccessGuide = 'shareAccessGuide'; + static const nationalIdOrIqamaNumber = 'nationalIdOrIqamaNumber'; } diff --git a/lib/ui/landing/dashboard_screen_for_dependet.dart b/lib/ui/landing/dashboard_screen_for_dependet.dart index 0403240..0c85221 100644 --- a/lib/ui/landing/dashboard_screen_for_dependet.dart +++ b/lib/ui/landing/dashboard_screen_for_dependet.dart @@ -366,9 +366,7 @@ class _DashboardScreenForDependetState extends State await Utils.saveStringFromPrefs("P_DEP_MOBILE_NUMBER", mobile); } String tokenID = - (AppState().postParamsObject?.tokenID != null && AppState().postParamsObject!.tokenID!.isNotEmpty) - ? AppState().postParamsObject!.tokenID! - : (AppState().authenticationTokenID ?? ""); + (AppState().postParamsObject?.tokenID != null && AppState().postParamsObject!.tokenID!.isNotEmpty) ? AppState().postParamsObject!.tokenID! : (AppState().authenticationTokenID ?? ""); if (tokenID.isNotEmpty) { await Utils.saveStringFromPrefs("P_DEP_TOKEN_ID", tokenID); } @@ -409,7 +407,7 @@ class _DashboardScreenForDependetState extends State message: LocaleKeys.areYouSureWantToLogOut.tr(), confirmText: LocaleKeys.yes.tr(), cancelText: LocaleKeys.no.tr(), - isDestructive: true, + isDestructive: false, onConfirm: () async { if (ApiConsts.isDependetLogin) { await _clearDependentPrefs(); @@ -497,11 +495,7 @@ class _DashboardScreenForDependetState extends State } }, ), - if (ApiConsts.isDependetLogin) IconButton( - icon: const Icon(Icons.logout_rounded, size: 24, color: Color(0xFF1E293B)), - tooltip: LocaleKeys.logout.tr(), - onPressed: _performLogout, - ), + if (ApiConsts.isDependetLogin) InkWell(onTap: _performLogout, child: SvgPicture.asset('assets/images/drawer/logout.svg', height: 20, width: 20)), ], ), ], diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 9299bfe..ca60b77 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -244,7 +244,7 @@ class _LoginScreenState extends State { bool autoLoggedIn = await _tryDependentAutoLogin(); if (autoLoggedIn) { return; - }else { + } else { dependentLoginInfo = await LoginApiClient().getMobileLoginInfoNEWDependent(devToken, devType, memberType: MemberType.dependent.value); Utils.hideLoading(context); if (dependentLoginInfo != null) { @@ -790,9 +790,7 @@ class _LoginScreenState extends State { String savedLoginType = await Utils.getStringFromPrefs("P_DEP_LOGIN_TYPE"); int loginType = int.tryParse(savedLoginType) ?? 1; - String effectiveToken = savedAuthToken.isNotEmpty - ? savedAuthToken - : (savedToken.isNotEmpty ? savedToken : savedLoginToken); + String effectiveToken = savedAuthToken.isNotEmpty ? savedAuthToken : (savedToken.isNotEmpty ? savedToken : savedLoginToken); if (nationalId.text.isEmpty) { nationalId.text = savedNid; @@ -847,13 +845,7 @@ class _LoginScreenState extends State { String devType = Platform.isAndroid ? "android" : "ios"; try { - GenericResponseModel? depLoginResponse = await LoginApiClient().memberLoginDependent( - nationalId: savedNid, - birthDate: savedDob, - deviceToken: devToken, - deviceType: devType, - context: context, - ); + GenericResponseModel? depLoginResponse = await LoginApiClient().memberLoginDependent(nationalId: savedNid, birthDate: savedDob, deviceToken: devToken, deviceType: devType, context: context); if (depLoginResponse?.errorMessage != null && depLoginResponse!.errorMessage!.isNotEmpty) { if (Utils.isMazayaAccessRevoked(depLoginResponse.errorMessage)) { @@ -866,22 +858,14 @@ class _LoginScreenState extends State { } if (depLoginResponse != null) { - String? authToken = (depLoginResponse.authenticationTokenID != null && depLoginResponse.authenticationTokenID!.trim().isNotEmpty) - ? depLoginResponse.authenticationTokenID!.trim() - : null; + String? authToken = (depLoginResponse.authenticationTokenID != null && depLoginResponse.authenticationTokenID!.trim().isNotEmpty) ? depLoginResponse.authenticationTokenID!.trim() : null; String? logInTokenID = depLoginResponse.logInTokenID; String? mobileNumber = depLoginResponse.getWalaplusDepInfoModel?.pEmpMobileNumber ?? savedMobile; if (authToken != null && authToken.isNotEmpty) { if (mounted) { Utils.hideLoading(context); - _completeDependentLogin( - depLoginResponse, - logInTokenID ?? authToken, - mobileNumber, - loginType: loginType, - navigateToDashboard: true, - ); + _completeDependentLogin(depLoginResponse, logInTokenID ?? authToken, mobileNumber, loginType: loginType, navigateToDashboard: true); } return true; } @@ -1043,7 +1027,7 @@ class _LoginScreenState extends State { 20.height, _buildDependentCtaCard(context), ] else ...[ - InputWidget(LocaleKeys.nationalId.tr(), "1234567890", nationalId, isInputTypeNum: true), + InputWidget(LocaleKeys.nationalIdOrIqamaNumber.tr(), "1234567890", nationalId, isInputTypeNum: true), 12.height, GestureDetector( behavior: HitTestBehavior.opaque, diff --git a/lib/widgets/input_widget.dart b/lib/widgets/input_widget.dart index 5059733..67eefae 100644 --- a/lib/widgets/input_widget.dart +++ b/lib/widgets/input_widget.dart @@ -65,10 +65,7 @@ class _InputWidgetState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: widget.isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white, - border: Border.all( - color: widget.isEnableBorder ? Color(0xffefefef) : Colors.transparent, - width: 1, - ), + border: Border.all(color: widget.isEnableBorder ? Color(0xffefefef) : Colors.transparent, width: 1), ), child: InkWell( onTap: widget.hasSelection ? () {} : null, @@ -79,15 +76,7 @@ class _InputWidgetState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - widget.labelText, - style: const TextStyle( - fontSize: 11, - fontWeight: FontWeight.w600, - color: Color(0xff2B353E), - letterSpacing: -0.44, - ), - ), + Text(widget.labelText, style: const TextStyle(fontSize: 11, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.44)), TextField( enabled: widget.isEnable, scrollPadding: EdgeInsets.zero, @@ -97,23 +86,11 @@ class _InputWidgetState extends State { obscuringCharacter: "*", obscureText: isObscureText, onChanged: widget.onChange, - style: const TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff2B353E), - letterSpacing: -0.44, - ), + style: const TextStyle(fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff2B353E), letterSpacing: -0.44), decoration: InputDecoration( isDense: true, hintText: widget.hintText, - hintStyle: const TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff575757), - letterSpacing: -0.56, - ), + hintStyle: const TextStyle(fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff575757), letterSpacing: -0.56), suffixIconConstraints: const BoxConstraints(minWidth: 50), suffixIcon: widget.suffixTap == null ? null : IconButton(icon: const Icon(Icons.mic, color: MyColors.darkTextColor), onPressed: widget.suffixTap), contentPadding: EdgeInsets.zero, @@ -131,7 +108,7 @@ class _InputWidgetState extends State { setState(() { isObscureText = !isObscureText; }); - }) + }), ], if (widget.hasSelection) Icon(Icons.keyboard_arrow_down_outlined), ],