navigation drawer improvement.

development
Sikander Saleem 5 years ago
parent a30ed559c8
commit a572a7c592

@ -211,52 +211,58 @@ class _CommonAppbarState extends State<CommonAppbar> {
), ),
), ),
Expanded( Expanded(
child: ListView.builder( child: ListView.builder(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(left: 24, right: 24), padding: EdgeInsets.only(left: 24, right: 24),
itemCount: navigationList.length, itemCount: navigationList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String icon = "assets/icons/${navigationList[index].mobileFontIcon}.svg"; String icon = "assets/icons/${navigationList[index].mobileFontIcon}.svg";
if (navigationList[index].parentId == 1) { var subList = navigationList.where((element) => element.parentId == navigationList[index].navigationId).toList();
return myListItem(icon, navigationList[index].navigationText, navigationList[index].orderNo == 1 ? true : false, onTap: () { return Column(
String url = navigationList[index]?.mobileNavigationUrl ?? ""; mainAxisSize: MainAxisSize.min,
if (url.isEmpty || url.length < 2) { children: [
return; if (navigationList[index].parentId == 1)
} myListItem(icon, navigationList[index].navigationText, navigationList[index].orderNo == 1 ? true : false, onTap: () {
Navigator.pushNamed(context, url, arguments: null); String url = navigationList[index]?.mobileNavigationUrl ?? "";
}); if (url.isEmpty || url.length < 2) {
} else { return;
return Container( }
width: double.infinity, Navigator.pushNamed(context, url, arguments: null);
child: Row( }),
children: [ for (var subItem in subList)
Expanded( Container(
child: myListItem(icon, navigationList[index].navigationText, false, onTap: () { width: double.infinity,
String url = navigationList[index]?.mobileNavigationUrl ?? ""; child: Row(
if (url.isEmpty) { children: [
return; Expanded(
} child: myListItem("assets/icons/${subItem.mobileFontIcon}.svg", subItem.navigationText, false, onTap: () {
var contentId; String url = subItem.mobileNavigationUrl ?? "";
if (navigationList[index].mobileNavigationUrl == "/introduction") { if (url.isEmpty) {
url = ContentInfoScreen.routeName; return;
contentId = 2; }
} else if (navigationList[index].mobileNavigationUrl == "/encyclopedia") { var contentId;
url = ContentInfoScreen.routeName; if (subItem.mobileNavigationUrl == "/introduction") {
contentId = 1; url = ContentInfoScreen.routeName;
} contentId = 2;
Navigator.pushNamed(context, url, arguments: contentId); } else if (subItem.mobileNavigationUrl == "/encyclopedia") {
}), url = ContentInfoScreen.routeName;
), contentId = 1;
Container( }
height: 40, Navigator.pushNamed(context, url, arguments: contentId);
margin: EdgeInsets.only(right: 17, left: 10), }),
child: VerticalDivider(color: ColorConsts.primaryBlack, thickness: .7, width: 1), ),
), Container(
], height: 40,
), margin: EdgeInsets.only(right: 17, left: 10),
); child: VerticalDivider(color: ColorConsts.primaryBlack, thickness: .7, width: 1),
} ),
})), ],
),
)
],
);
}),
),
Container( Container(
margin: EdgeInsets.only(top: 16, bottom: 12), margin: EdgeInsets.only(top: 16, bottom: 12),
padding: EdgeInsets.only(left: 32, right: 32), padding: EdgeInsets.only(left: 32, right: 32),
@ -269,23 +275,23 @@ class _CommonAppbarState extends State<CommonAppbar> {
], ],
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only(left: 32, right: 32, bottom: 8), padding: EdgeInsets.only(left: 32, right: 32, bottom: 8),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"Powered by Cloud Solutions", "Powered by Cloud Solutions",
maxLines: 1, maxLines: 1,
textAlign: TextAlign.right, textAlign: TextAlign.right,
style: TextStyle(fontSize: 14,color: Colors.black87), style: TextStyle(fontSize: 14, color: Colors.black87),
), ),
SizedBox(width: 8), SizedBox(width: 8),
SvgPicture.asset("assets/logos/cloud_logo.svg", width: 30, height: 30) SvgPicture.asset("assets/logos/cloud_logo.svg", width: 30, height: 30)
], ],
), ),
) )
], ],
), ),
), ),

Loading…
Cancel
Save