|
|
|
|
@ -20,7 +20,7 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
return Consumer<DashboardProviderModel>(
|
|
|
|
|
builder: (cxt, data, child) {
|
|
|
|
|
return GridView(
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 9, mainAxisSpacing: 9),
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.75, crossAxisSpacing: 9, mainAxisSpacing: 9),
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
primary: false,
|
|
|
|
|
@ -53,25 +53,52 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.workList);
|
|
|
|
|
}),
|
|
|
|
|
if(env.dashboard.missingSwipe)
|
|
|
|
|
data.isMissingSwipeLoading
|
|
|
|
|
if (env.dashboard.missingSwipe)
|
|
|
|
|
data.isMissingSwipeLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(namesColor[1]),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
),
|
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
|
|
|
|
|
}),
|
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(namesColor[1]),
|
|
|
|
|
color: Color(namesColor[2]),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
|
|
|
|
|
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
),
|
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
|
],
|
|
|
|
|
@ -79,7 +106,7 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.leaveBalance);
|
|
|
|
|
}),
|
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
@ -94,11 +121,11 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
|
|
|
|
|
LocaleKeys.businessTripBalance.tr().toText12(color: Colors.white),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
child: data.businessTrip.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
),
|
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
|
],
|
|
|
|
|
@ -108,10 +135,39 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.leaveBalance);
|
|
|
|
|
}),
|
|
|
|
|
if(env.dashboard.ticketBalance)
|
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
|
if (env.dashboard.ticketBalance)
|
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(namesColor[3]),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
),
|
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
).onPress(
|
|
|
|
|
() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
data.isMyRequestLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
|
data.fetchListMenu();
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
@ -122,12 +178,13 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
|
|
|
|
|
LocaleKeys.myRequest.tr().toText12(color: Colors.white),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
|
// ),
|
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
@ -135,7 +192,7 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
).onPress(
|
|
|
|
|
() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.myRequests,arguments: data.myRequest!.requestGroupId);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
|