swipe module and reset password added

design_3.0_latest
WaseemAbbasi22 10 months ago
parent a5876ec1d3
commit 08428fc745

@ -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) {

@ -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"),
),
],
);
}
),
),),
),
],
),
),
],
);
}
}

@ -21,7 +21,6 @@ class RequestCategoryFragment extends StatelessWidget {
Widget build(BuildContext context) {
return Consumer<DashBoardProvider>(builder: (context, dashboardProvider, child) {
bool isNurse = (Provider.of<UserProvider>(context, listen: false).user?.type) == UsersTypes.normal_user;
debugPrint('condition i got is ${dashboardProvider.requestDetailList }');
return Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
//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 ?? <Data>[], dashboardProvider.isDetailLoading, dashboardProvider.requestDetailList?.totalRows ?? 0),
]);
});

Loading…
Cancel
Save