|
|
|
|
@ -107,15 +107,15 @@ class _DashboardViewState extends State<DashboardView> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
bool isNurse = (Provider.of<UserProvider>(context, listen: false).user!.type) == UsersTypes.normal_user;
|
|
|
|
|
final user = Provider.of<UserProvider>(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<DashboardView> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
//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<UserProvider>(
|
|
|
|
|
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<UserProvider>(
|
|
|
|
|
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"),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
),),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|