- Fancy animations.
- Customizable colors.
- Works with the back button.
- Scrolling pages by gestures.
- Indicator that follows the scroll.
- Easy and powerful implementation! :)
- Page movement when tapping an icon.
return ScrollNavigation(
pages: [
Screen(title: title("Camera")),
Screen(title: title("Messages"), backgroundColor: Colors.yellow[50]),
Screen(title: title("Favor"), body: Container(color: Colors.cyan[50])),
Screen(title: title("Activity"), backgroundColor: Colors.yellow[50]),
Screen(title: title("Home"))
],
navItems: const [
ScrollNavigationItem(icon: Icon(Icons.camera)),
ScrollNavigationItem(icon: Icon(Icons.chat)),
ScrollNavigationItem(icon: Icon(Icons.favorite)),
ScrollNavigationItem(icon: Icon(Icons.notifications)),
ScrollNavigationItem(
icon: Icon(Icons.home),
activeIcon: Icon(Icon: verified_user),
),
],
pagesActionButtons: [
FloatingActionButton( //PAGE 1
child: Icon(Icons.receipt),onPressed: () => null
),
null,
FloatingActionButton( //PAGE 3
child: Icon(Icons.sync), onPressed: () => null,
),
null,
FloatingActionButton( //PAGE 5
child: Icon(Icons.add), onPressed: () => print("Cool :)"),
),
],
);
NavigationPosition.top |
NavigationPosition.bottom |
|
|
Go to a Page Code
final navigationKey = GlobalKey<ScrollNavigationState>();
@override
Widget build(BuildContext context) {
return ScrollNavigation(
key: navigationKey,
pages: [...],
items: [...],
barStyle: NavigationBarStyle(position: NavigationPosition.top),
);
}
void goToPage(int index) => navigationKey.currentState.goToPage(index);
physics: true |
physics: False |
|
|
NavigationPosition.top |
showIdentifier: False |
|
|
Code
return ScrollNavigation(
pages: [...],
items: [...],
physics: true,
showIdentifier: true,
identiferStyle: NavigationIdentiferStyle(
position: NavigationPosition.top,
),
);
Without Widgets |
With Widgets |
|
|
return Screen();
return Screen(
title: title("Home"), //Function in the Example
leftWidget: Icon(Icons.menu, color: Colors.grey),
rightWidget: Icon(Icons.favorite, color: Colors.grey),
);
Code
ScrollController controller = ScrollController();
return Screen(
height: 56.0,
elevation: 0.0,
centerTitle: false,
title: title("Title Scroll"),
leftWidget: ScreenReturnButton(), //IMPORTANT TO RETURN!
controllerToHideAppBar: controller,
body: ListView.builder(
itemCount: 15,
controller: controller,
itemBuilder: (context, key) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 5),
child: Container(
height: 50,
color: Colors.blue[50],
),
);
},
),
);
Code
return TitleScrollNavigation(
barStyle: TitleNavigationBarStyle(
style: TextStyle(fontWeight: FontWeight.bold),
padding: EdgeInsets.symmetric(horizontal: 40.0),
spaceBetween: 40,
),
titles: [
"Main Page",
"Personal Information",
"Personalization",
"Security",
"Payment Methods",
],
pages: [
Container(color: Colors.blue[50]),
Container(color: Colors.red[50]),
Container(color: Colors.green[50]),
Container(color: Colors.purple[50]),
Container(color: Colors.yellow[50]),
],
);