|
|
|
|
@ -2,6 +2,7 @@ import 'package:easy_localization/src/public_ext.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/colors.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
|
@ -14,6 +15,16 @@ import 'package:provider/provider.dart';
|
|
|
|
|
class MenusWidget extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
Widget disabledWidget = Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.grey.withOpacity(0.6)),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.lock_outline,
|
|
|
|
|
color: MyColors.grey57Color,
|
|
|
|
|
size: 40,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
List<int> namesColor = [0xff125765, 0xff239D8F, 0xff2BB8A8, 0xff1D92AA];
|
|
|
|
|
|
|
|
|
|
return Consumer<DashboardProviderModel>(
|
|
|
|
|
@ -29,7 +40,9 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context, showLoading: true);
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(namesColor[0]),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
@ -49,14 +62,22 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
),
|
|
|
|
|
if (AppState().isDisclosureEnabled) ...[disabledWidget]
|
|
|
|
|
],
|
|
|
|
|
).onPress(() {
|
|
|
|
|
if (AppState().isDisclosureEnabled) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.workList);
|
|
|
|
|
}),
|
|
|
|
|
data.isMissingSwipeLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(namesColor[1]),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
@ -76,14 +97,22 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
),
|
|
|
|
|
if (AppState().isDisclosureEnabled) ...[disabledWidget]
|
|
|
|
|
],
|
|
|
|
|
).onPress(() {
|
|
|
|
|
if (AppState().isDisclosureEnabled) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
|
|
|
|
|
}),
|
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(namesColor[2]),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
@ -103,14 +132,22 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
),
|
|
|
|
|
if (AppState().isDisclosureEnabled) ...[disabledWidget]
|
|
|
|
|
],
|
|
|
|
|
).onPress(() {
|
|
|
|
|
if (AppState().isDisclosureEnabled) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.leaveBalance);
|
|
|
|
|
}),
|
|
|
|
|
data.isLeaveTicketBalanceLoading
|
|
|
|
|
? MenuShimmer().onPress(() {
|
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
|
})
|
|
|
|
|
: Container(
|
|
|
|
|
: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(namesColor[3]),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
@ -130,8 +167,14 @@ class MenusWidget extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
|
|
|
|
|
),
|
|
|
|
|
if (AppState().isDisclosureEnabled) ...[disabledWidget]
|
|
|
|
|
],
|
|
|
|
|
).onPress(
|
|
|
|
|
() {
|
|
|
|
|
if (AppState().isDisclosureEnabled) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|