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 (isHighPriority) body["isHighPriority"] = true;
if (isOverdue) body["isOverdue"] = true; if (isOverdue) body["isOverdue"] = true;
response = await ApiManager.instance.post(url, body: body); response = await ApiManager.instance.post(url, body: body);
print('data i got is ${response.body}');
stateCode = response.statusCode; stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) { if (response.statusCode >= 200 && response.statusCode < 300) {

@ -107,15 +107,15 @@ class _DashboardViewState extends State<DashboardView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isNurse = (Provider.of<UserProvider>(context, listen: false).user!.type) == UsersTypes.normal_user; bool isNurse = (Provider.of<UserProvider>(context, listen: false).user!.type) == UsersTypes.normal_user;
final user = Provider.of<UserProvider>(context, listen: false).user; final user = Provider.of<UserProvider>(context, listen: false).user;
return Scaffold( return Stack(
appBar: PreferredSize( children: [
preferredSize: const Size.fromHeight(kToolbarHeight), Scaffold(
child: AppBarWidget( appBar: PreferredSize(
onDrawerPress: widget.onDrawerPress, preferredSize: const Size.fromHeight(kToolbarHeight),
)), child: AppBarWidget(
body: Stack( onDrawerPress: widget.onDrawerPress,
children: [ )),
RefreshIndicator( body: RefreshIndicator(
onRefresh: () async { onRefresh: () async {
getRequests(); getRequests();
return Future.delayed(const Duration(milliseconds: 250)); 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) if (user!=null&&user.employeeIsHMG==false)
Positioned( Positioned(
right: user.type == UsersTypes.engineer ? 20.toScreenWidth : null, right: 20.toScreenWidth ,
left: user.type != UsersTypes.engineer ? 20.toScreenWidth : null, bottom: 20.toScreenHeight,
bottom: 20.toScreenHeight, child: GestureDetector(
child: GestureDetector( onTap: () async {
onTap: () async { bool isNfcSupported = await NfcManager.instance.isAvailable();
bool isNfcSupported = await NfcManager.instance.isAvailable(); SwipeGeneralUtils.instance.showSwipeTypeBottomSheetSheet(isNfcSupported: isNfcSupported);
SwipeGeneralUtils.instance.showSwipeTypeBottomSheetSheet(isNfcSupported: isNfcSupported); },
}, child: CircularAnimatedContainer(child: Container(
child: CircularAnimatedContainer(child: Container( width: 100.toScreenWidth,
width: 100.toScreenWidth, height: 100.toScreenHeight,
height: 100.toScreenHeight, decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.circle,
shape: BoxShape.circle, color: AppColor.white10,
color: AppColor.white10, border: Border.all(color: AppColor.primary10.withOpacity(0.5), width: 2),
border: Border.all(color: AppColor.primary10.withOpacity(0.5), width: 2), ),
), child: Consumer<UserProvider>(
child: Consumer<UserProvider>( builder: (context, userProvider,child) {
builder: (context, userProvider,child) { return Column(
return Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ 'swipe'.toSvgAsset(width: 32, height: 32),
'swipe'.toSvgAsset(width: 32, height: 32), 8.height,
8.height, Text(
Text( ("${context.translation.checkIn}\n${userProvider.swipeTransactionModel.swipeTime != null ? SwipeGeneralUtils.instance.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime!) : '--:--'}"),
("${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"),
style: AppTextStyles.bodyText2.copyWith(color: AppColor.white936, fontWeight: FontWeight.w500, fontFamily: "Poppins"), ),
),
],
], );
); }
} ),
), ),),
),),
),
), ),
], ),
), ],
); );
} }
} }

@ -21,7 +21,6 @@ class RequestCategoryFragment extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<DashBoardProvider>(builder: (context, dashboardProvider, child) { return Consumer<DashBoardProvider>(builder: (context, dashboardProvider, child) {
bool isNurse = (Provider.of<UserProvider>(context, listen: false).user?.type) == UsersTypes.normal_user; 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>[ return Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
//TODO uncommit this to get the calendar card.. //TODO uncommit this to get the calendar card..
@ -65,7 +64,7 @@ class RequestCategoryFragment extends StatelessWidget {
); );
})).paddingOnly(start: 16, end: 16, top: 16) })).paddingOnly(start: 16, end: 16, top: 16)
: (dashboardProvider.requestDetailList==null||dashboardProvider.requestDetailList?.data?.isEmpty==true) : (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), : RequestCategoryList(dashboardProvider.requestDetailList?.data ?? <Data>[], dashboardProvider.isDetailLoading, dashboardProvider.requestDetailList?.totalRows ?? 0),
]); ]);
}); });

Loading…
Cancel
Save