diff --git a/lib/dashboard_latest/dashboard_provider.dart b/lib/dashboard_latest/dashboard_provider.dart index ff6df398..0e24590d 100644 --- a/lib/dashboard_latest/dashboard_provider.dart +++ b/lib/dashboard_latest/dashboard_provider.dart @@ -270,7 +270,6 @@ class DashBoardProvider extends ChangeNotifier { if (isHighPriority) body["isHighPriority"] = true; if (isOverdue) body["isOverdue"] = true; response = await ApiManager.instance.post(url, body: body); - print('data i got is ${response.body}'); stateCode = response.statusCode; if (response.statusCode >= 200 && response.statusCode < 300) { diff --git a/lib/dashboard_latest/dashboard_view.dart b/lib/dashboard_latest/dashboard_view.dart index 3caa6abf..15b8d82a 100644 --- a/lib/dashboard_latest/dashboard_view.dart +++ b/lib/dashboard_latest/dashboard_view.dart @@ -107,15 +107,15 @@ class _DashboardViewState extends State { Widget build(BuildContext context) { bool isNurse = (Provider.of(context, listen: false).user!.type) == UsersTypes.normal_user; final user = Provider.of(context, listen: false).user; - return Scaffold( - appBar: PreferredSize( - preferredSize: const Size.fromHeight(kToolbarHeight), - child: AppBarWidget( - onDrawerPress: widget.onDrawerPress, - )), - body: Stack( - children: [ - RefreshIndicator( + return Stack( + children: [ + Scaffold( + appBar: PreferredSize( + preferredSize: const Size.fromHeight(kToolbarHeight), + child: AppBarWidget( + onDrawerPress: widget.onDrawerPress, + )), + body: RefreshIndicator( onRefresh: () async { getRequests(); return Future.delayed(const Duration(milliseconds: 250)); @@ -133,47 +133,45 @@ class _DashboardViewState extends State { ), ), ), - //TODO need to fix the alignment when no data is found + ), if (user!=null&&user.employeeIsHMG==false) - Positioned( - right: user.type == UsersTypes.engineer ? 20.toScreenWidth : null, - left: user.type != UsersTypes.engineer ? 20.toScreenWidth : null, - bottom: 20.toScreenHeight, - child: GestureDetector( - onTap: () async { - bool isNfcSupported = await NfcManager.instance.isAvailable(); - SwipeGeneralUtils.instance.showSwipeTypeBottomSheetSheet(isNfcSupported: isNfcSupported); - }, - child: CircularAnimatedContainer(child: Container( - width: 100.toScreenWidth, - height: 100.toScreenHeight, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: AppColor.white10, - border: Border.all(color: AppColor.primary10.withOpacity(0.5), width: 2), - ), - child: Consumer( - builder: (context, userProvider,child) { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - 'swipe'.toSvgAsset(width: 32, height: 32), - 8.height, - Text( - ("${context.translation.checkIn}\n${userProvider.swipeTransactionModel.swipeTime != null ? SwipeGeneralUtils.instance.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime!) : '--:--'}"), - style: AppTextStyles.bodyText2.copyWith(color: AppColor.white936, fontWeight: FontWeight.w500, fontFamily: "Poppins"), - ), - - ], - ); - } - ), - ),), - ), + Positioned( + right: 20.toScreenWidth , + bottom: 20.toScreenHeight, + child: GestureDetector( + onTap: () async { + bool isNfcSupported = await NfcManager.instance.isAvailable(); + SwipeGeneralUtils.instance.showSwipeTypeBottomSheetSheet(isNfcSupported: isNfcSupported); + }, + child: CircularAnimatedContainer(child: Container( + width: 100.toScreenWidth, + height: 100.toScreenHeight, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: AppColor.white10, + border: Border.all(color: AppColor.primary10.withOpacity(0.5), width: 2), + ), + child: Consumer( + builder: (context, userProvider,child) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + 'swipe'.toSvgAsset(width: 32, height: 32), + 8.height, + Text( + ("${context.translation.checkIn}\n${userProvider.swipeTransactionModel.swipeTime != null ? SwipeGeneralUtils.instance.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime!) : '--:--'}"), + style: AppTextStyles.bodyText2.copyWith(color: AppColor.white936, fontWeight: FontWeight.w500, fontFamily: "Poppins"), + ), + + ], + ); + } + ), + ),), ), - ], - ), + ), + ], ); } } diff --git a/lib/dashboard_latest/widgets/request_category_fragment.dart b/lib/dashboard_latest/widgets/request_category_fragment.dart index cf77a2e4..e4861640 100644 --- a/lib/dashboard_latest/widgets/request_category_fragment.dart +++ b/lib/dashboard_latest/widgets/request_category_fragment.dart @@ -21,7 +21,6 @@ class RequestCategoryFragment extends StatelessWidget { Widget build(BuildContext context) { return Consumer(builder: (context, dashboardProvider, child) { bool isNurse = (Provider.of(context, listen: false).user?.type) == UsersTypes.normal_user; - debugPrint('condition i got is ${dashboardProvider.requestDetailList }'); return Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ //TODO uncommit this to get the calendar card.. @@ -65,7 +64,7 @@ class RequestCategoryFragment extends StatelessWidget { ); })).paddingOnly(start: 16, end: 16, top: 16) : (dashboardProvider.requestDetailList==null||dashboardProvider.requestDetailList?.data?.isEmpty==true) - ? const NoDataFound().paddingOnly(top: 50).center + ? const NoDataFound().paddingOnly(top: 80).center : RequestCategoryList(dashboardProvider.requestDetailList?.data ?? [], dashboardProvider.isDetailLoading, dashboardProvider.requestDetailList?.totalRows ?? 0), ]); });