From 9c4151a0fc0d65aa175dd5fa332665eed80191f0 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 30 Dec 2024 15:10:27 +0300 Subject: [PATCH] nfc & ui improvements --- android/AtomsSA-playStore.jks | Bin 2575 -> 0 bytes android/key.properties | 3 +- lib/new_views/pages/land_page/land_page.dart | 50 +++++++++++------- .../swipe_module/swipe_success_view.dart | 4 +- .../utils/swipe_general_utils.dart | 18 +++---- 5 files changed, 40 insertions(+), 35 deletions(-) delete mode 100644 android/AtomsSA-playStore.jks diff --git a/android/AtomsSA-playStore.jks b/android/AtomsSA-playStore.jks deleted file mode 100644 index 0d4a261e913fb6a5bc64b367190a310afd79d433..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2575 zcma)+c{mh`8pda3rZZzC>rAo}!YEnFSi+zNhh(orGswP7)?&s|7;D+rhCz16awZ&0 z$&x)=veXeX*@=isr{}r%Ip^NL?)~F?zUTYB-~0agVyVY|0Rh2SD!hvWE*E1IvyTLF z0t>0|MhF#N_Y+rPsnCZ1lAsI-75d~S&igr89KZbAg*XNT6;h!(KcOa;^tS_w#M)xj z|2Yv@c?j=u!qF4k6>|co>I23>t=72lK7y*f3 z2v82fouguXx>vj^jTHyI&#c)~MwKNlA3!3$dbZQUC!07hUhdNTE?Bqys=|O5LYXI>udZhm1jd9Zv zxy1|Z5lbs)@)cetm8TN67+5pDODc)Gjo+WKdsLpjrmLJlXf;mDC}#M5Y}K&pU-5Cl z9KO{qOb5KuPkgpuDFgvc*2HSLeE(K5w?x4xQjTuqXrCN%^RzNYzGHj*;6Upfeqi}S zgyyG5jgr{qy6xz2>D#W0b;Fgj(wMG|kgDe7>m~O89SI^`l+qhln~+9@Fys z1^2Rly1iN?_30aO z;0E>?D$6e8j(q9b5eQ61VC+*?lbxm!L(agZ7P!^8{`vO3{f@5>$ZaxSu(l}AK|E=e zhHLh4vos^ZGS!^gFfLsKc_#)FdXRlizQrIOXHswS#R~JUZ+;AxxnnWk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ZaH%99qA z&0dop=$gtA3$yxYXVI_puH;40cQ9*b5g`lVI R7)iuO>+Gsc5EvL!_!pQMnLPji diff --git a/android/key.properties b/android/key.properties index ef160512..a181d7ac 100644 --- a/android/key.properties +++ b/android/key.properties @@ -1,5 +1,4 @@ storePassword=Cloud@AtomsSA keyPassword=Cloud@AtomsSA keyAlias=playstore -#storeFile=/Users/sikandersaleem/StudioProjects/cloudsolutions-atoms/android/AtomsSA-playStore.jks -storeFile=/Users/waseem/CsProjects/android/AtomsSA-playStore.jks +storeFile=AtomsSA-playStore.jks \ No newline at end of file diff --git a/lib/new_views/pages/land_page/land_page.dart b/lib/new_views/pages/land_page/land_page.dart index 51e3a009..30e3a0f1 100644 --- a/lib/new_views/pages/land_page/land_page.dart +++ b/lib/new_views/pages/land_page/land_page.dart @@ -11,17 +11,16 @@ import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/string_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart'; -import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/models/enums/user_types.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; import 'package:test_sa/new_views/pages/land_page/calendar_page.dart'; import 'package:test_sa/new_views/pages/land_page/my_request/my_requests_page.dart'; -import 'package:test_sa/new_views/swipe_module/mark_attendance_widget.dart'; import 'package:test_sa/new_views/pages/settings_page.dart'; import 'package:test_sa/new_views/swipe_module/swipe_success_view.dart'; import 'package:test_sa/new_views/swipe_module/utils/swipe_general_utils.dart'; import 'package:test_sa/views/widgets/equipment/single_device_picker.dart'; + import '../../../controllers/providers/settings/setting_provider.dart'; import '../../../views/widgets/dialogs/dialog.dart'; import '../../common_widgets/app_bottom_nav_bar.dart'; @@ -49,7 +48,6 @@ class _LandPageState extends State { @override void initState() { _pages = []; - super.initState(); } @@ -103,19 +101,19 @@ class _LandPageState extends State { } } - Future checkNfcSupported() async { - isNfcSupported = await NfcManager.instance.isAvailable(); - setState(() {}); - } + // Future checkNfcSupported() async { + // isNfcSupported = await NfcManager.instance.isAvailable(); + // setState(() {}); + // } @override Widget build(BuildContext context) { if (_userProvider == null) { _userProvider = Provider.of(context, listen: false); // if (_userProvider.isUserConfirmSwipe) { - if (!_userProvider.user.employeeIsHMG) { - checkNfcSupported(); - } + // if (!_userProvider.user.employeeIsHMG) { + // checkNfcSupported(); + // } _pages = [ DashboardPage(onDrawerPress: (() { _scaffoldKey.currentState.isDrawerOpen ? _scaffoldKey.currentState.closeDrawer() : _scaffoldKey.currentState.openDrawer(); @@ -191,17 +189,18 @@ class _LandPageState extends State { ), if (userProvider.user != null && !userProvider.user.employeeIsHMG) Positioned( - right:_userProvider.user.type==UsersTypes.engineer? 20.toScreenWidth:null, - left:_userProvider.user.type!=UsersTypes.engineer? 20.toScreenWidth:null , + right: _userProvider.user.type == UsersTypes.engineer ? 20.toScreenWidth : null, + left: _userProvider.user.type != UsersTypes.engineer ? 20.toScreenWidth : null, bottom: 130.toScreenHeight, child: GestureDetector( - onTap: () { + onTap: () async { + isNfcSupported = await NfcManager.instance.isAvailable(); SwipeGeneralUtils.showSwipeTypeBottomSheetSheet(context: context, isNfcSupported: isNfcSupported); }, child: CircularAnimationWithProgressIndicator( child: Container( - width: 120.toScreenWidth, - height: 120.toScreenHeight, + width: 100.toScreenWidth, + height: 100.toScreenHeight, decoration: const BoxDecoration( shape: BoxShape.circle, color: AppColor.white, @@ -212,11 +211,22 @@ class _LandPageState extends State { children: [ 'swipe'.toSvgAsset(width: 32, height: 32), 8.height, - context.translation.checkIn.bodyText(context).custom(color: AppColor.neutral80), - 8.height, - userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null - ? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime).bodyText(context).custom(color: AppColor.neutral80) - : '--:--'.bodyText(context).custom(color: AppColor.neutral80), + Text( + ("${context.translation.checkIn}\n${userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null ? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime) : '--:--'}"), + style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral80, fontWeight: FontWeight.w500, fontFamily: "Poppins"), + ), + + // (context.translation.checkIn + + // "\n" + + // (userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null + // ? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime) + // : '--:--')) + // .bodyText2(context) + // .custom(color: AppColor.neutral80), + // 8.height, + // userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null + // ? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime).bodyText2(context).custom(color: AppColor.neutral80) + // : '--:--'.bodyText(context).custom(color: AppColor.neutral80), ], ), ), diff --git a/lib/new_views/swipe_module/swipe_success_view.dart b/lib/new_views/swipe_module/swipe_success_view.dart index 3b36e1af..8de8d847 100644 --- a/lib/new_views/swipe_module/swipe_success_view.dart +++ b/lib/new_views/swipe_module/swipe_success_view.dart @@ -76,8 +76,8 @@ class _CircularAnimationWithProgressIndicatorState ); }, child: SizedBox( - width: 120.toScreenHeight, - height: 120.toScreenWidth, + width: 100.toScreenHeight, + height: 100.toScreenWidth, child: const CircularProgressIndicator( strokeWidth: 3.0, backgroundColor: AppColor.primary30, diff --git a/lib/new_views/swipe_module/utils/swipe_general_utils.dart b/lib/new_views/swipe_module/utils/swipe_general_utils.dart index d430b29f..2d85c063 100644 --- a/lib/new_views/swipe_module/utils/swipe_general_utils.dart +++ b/lib/new_views/swipe_module/utils/swipe_general_utils.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:developer'; import 'dart:io'; -import 'package:flutter/cupertino.dart'; + import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:geolocator/geolocator.dart'; @@ -29,7 +29,6 @@ import 'package:test_sa/new_views/swipe_module/models/swipe_model.dart'; import 'package:test_sa/new_views/swipe_module/swipe_success_view.dart'; import 'package:test_sa/new_views/swipe_module/utils/location_utils.dart'; - class SwipeGeneralUtils { static bool _isLoadingVisible = false; @@ -178,7 +177,6 @@ class SwipeGeneralUtils { ); } - static void showErrorDialog({String message, @required BuildContext context}) { showDialog( context: context, @@ -214,7 +212,7 @@ class SwipeGeneralUtils { return Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: Colors.white, + color: isEnabled ? Colors.white : AppColor.white40, borderRadius: BorderRadius.circular(18), border: Border.all(color: AppColor.white40, width: 2), ), @@ -222,13 +220,12 @@ class SwipeGeneralUtils { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - icon.toSvgAsset(), - title.heading5(context).custom(color: AppColor.neutral50), + icon.toSvgAsset(color: isEnabled ? null : Colors.grey.withOpacity(0.5)), + title.heading5(context).custom(color: isEnabled ? AppColor.neutral50 : Colors.grey.withOpacity(0.5)), ], ), ).onPress( () { - log('isEnabled is ${!isEnabled}'); if (!isEnabled) return; onPress(); }, @@ -533,7 +530,7 @@ class SwipeGeneralUtils { @required bool isEnable, @required BuildContext context, }) async { - if (!(await isGoogleServicesAvailable())) { + if (!(await isGoogleServicesAvailable())) { checkHuaweiLocationPermission(attendanceType: swipeType, context: context); } else { LocationUtilities.isEnabled((bool isEnabled) { @@ -592,7 +589,7 @@ class SwipeGeneralUtils { static List availableAttendanceMethodList({@required BuildContext context, @required UserProvider userProvider, @required bool isNfcSupported}) { List availableMethods = []; if (userProvider.user.enableNFC) { - availableMethods.add(attendanceTypeCard(SwipeTypeEnum.NFC.name, 'nfc_icon', userProvider.user.enableNFC, () { + availableMethods.add(attendanceTypeCard(SwipeTypeEnum.NFC.name, 'nfc_icon', isNfcSupported, () { handleSwipe(swipeType: SwipeTypeEnum.NFC, isEnable: userProvider.user.enableNFC, context: navigatorKey.currentState.overlay.context); }, context)); } @@ -687,7 +684,6 @@ class SwipeGeneralUtils { // } } - // // static Widget getNoDataWidget(BuildContext context) { // return Column( @@ -906,4 +902,4 @@ class SwipeGeneralUtils { // } // } // return selectedDate; -// } \ No newline at end of file +// }