services dynamic list issue fixed on payslip

merge-requests/23/head
Sikander Saleem 3 years ago
parent eea0df3614
commit c29d003401

@ -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<GetMenuEntriesList> menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? [];
List<GetMenuEntriesList> 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<GetMenuEntriesList> _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;
}

Loading…
Cancel
Save