|
|
|
@ -16,12 +16,13 @@ import 'package:provider/provider.dart';
|
|
|
|
class MenusWidget extends StatelessWidget {
|
|
|
|
class MenusWidget extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
List<int> namesColor = [0xff125765, 0xff239D8F, 0xff2BB8A8, 0xff1D92AA];
|
|
|
|
// List<int> namesColor = [0xff125765, 0xff239D8F, 0xff2BB8A8, 0xff1D92AA];
|
|
|
|
|
|
|
|
List<int> namesColor = [0xff1C4B6D, 0xff33678D, 0xff9FB7C4, 0xff5FA5A0];
|
|
|
|
|
|
|
|
|
|
|
|
return Consumer<DashboardProviderModel>(
|
|
|
|
return Consumer<DashboardProviderModel>(
|
|
|
|
builder: (cxt, data, child) {
|
|
|
|
builder: (cxt, data, child) {
|
|
|
|
return GridView(
|
|
|
|
return GridView(
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.75, crossAxisSpacing: 9, mainAxisSpacing: 9),
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 78 / 75, crossAxisSpacing: 9, mainAxisSpacing: 9),
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
primary: false,
|
|
|
|
primary: false,
|
|
|
|
@ -40,11 +41,11 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.workList.tr().toText12(color: Colors.white),
|
|
|
|
LocaleKeys.workList.tr().toText10(color: Colors.white, letterSpacing: -0.6),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
child: data.workListCounter.toString().toText14(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)),
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -68,11 +69,11 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
|
|
|
|
LocaleKeys.missingSwipes.tr().toText10(color: Colors.white, letterSpacing: -0.6),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
child: data.missingSwipeCounter.toString().toText14(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)),
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -95,11 +96,11 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
|
|
|
|
LocaleKeys.businessTripBalance.tr().toText10(color: Colors.white, letterSpacing: -0.6),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: (data.leaveBalance)!.toStringAsFixed(0).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
child: data.businessTrip.toStringAsFixed(0).toText14(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)),
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -107,7 +108,8 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
).onPress(() {
|
|
|
|
).onPress(() {
|
|
|
|
Navigator.pushNamed(context, AppRoutes.leaveBalance);
|
|
|
|
//Navigator.pushNamed(context, AppRoutes.leaveBalance);
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.business_mission.tr(), "XXX_HR_EIT_BUSINESS_MISSION_SS"));
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
@ -115,18 +117,18 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Color(namesColor[2]),
|
|
|
|
color: Color(namesColor[1]),
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.businessTripBalance.tr().toText12(color: Colors.white),
|
|
|
|
LocaleKeys.leaveBalance.tr().toText10(color: Colors.white, letterSpacing: -0.6),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: data.businessTrip.toStringAsFixed(0).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
child: (data.leaveBalance)!.toStringAsFixed(0).toText14(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)),
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -134,10 +136,7 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
).onPress(() {
|
|
|
|
).onPress(() {
|
|
|
|
//Navigator.pushNamed(context, AppRoutes.leaveBalance);
|
|
|
|
Navigator.pushNamed(context, AppRoutes.leaveBalance);
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.business_mission.tr(), "XXX_HR_EIT_BUSINESS_MISSION_SS"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
if (env.dashboard.ticketBalance)
|
|
|
|
if (env.dashboard.ticketBalance)
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
@ -153,11 +152,11 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
|
|
|
|
LocaleKeys.ticketBalance.tr().toText10(color: Colors.white, letterSpacing: -0.6),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
child: data.ticketBalance.toStringAsFixed(2).toText14(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)),
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -182,14 +181,15 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.myRequest.tr().toText12(color: Colors.white),
|
|
|
|
LocaleKeys.myRequest.tr().toText10(color: Colors.white, letterSpacing: -0.6),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// Expanded(
|
|
|
|
// Expanded(
|
|
|
|
// child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
|
|
|
|
// 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)),
|
|
|
|
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white).paddingOnly(bottom: 4)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|