diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index ecb0641..a6f4151 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -49,7 +49,6 @@ class ServicesWidget extends StatelessWidget { padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), scrollDirection: Axis.horizontal, itemBuilder: (cxt, index) { - return AspectRatio( aspectRatio: 105 / 105, child: data.isServicesMenusLoading @@ -77,11 +76,7 @@ class ServicesWidget extends StatelessWidget { Expanded( child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText10(isBold: true), ), - RotatedBox( - quarterTurns: AppState().isArabic(context) ? 2:4, - child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4) - ), - + RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), ], ) ], @@ -119,7 +114,7 @@ class ServicesWidget extends StatelessWidget { Navigator.of(context).pushNamed(AppRoutes.profile); return; } - List menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? []; + List menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION")).toList() ?? []; menuEntry.icon = ""; if (menuList.isEmpty) { if (menuEntry.requestType == "EIT") { @@ -128,7 +123,12 @@ class ServicesWidget extends StatelessWidget { Navigator.pushNamed(context, AppRoutes.monthlyPaySlip); } } else { - Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, menuList)); + List _menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? []; + if (_menuList.isEmpty) { + Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, menuList)); + } else { + Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, _menuList)); + } } return; }