animated navigation bar
a flutter implementation of a customizable navigation bar with animations.
getting started
add the following dependency in the pubspec.yaml
of your flutter project :
dependencies:
...
animated_navigation_bar:
import the package :
import 'package:animated_navigation_bar/animatednavbar.dart';
if you need help getting started with flutter, head over to the official documentation documentation.
constructors
you can create an animatednavbar
by calling its constructor and passing a list of animatednavbarpage
as your scaffold
body
scaffold(
body: animatednavbar(
pages: <animatednavbarpage>[
animatednavbarpage(),
animatednavbarpage(),
...
]
),
an animatednavbar
requires multiple things:
- a
color
, to fill the navigation view and bar with a background color - a
borderradius
with a radius ranged between 0 and 24 - and a list of
animatednavbarpage
as mentioned before with a maximum length of 5 and a minimumm of 1
an animatednavbarpage
requires multiple things:
- a
text
of the tab bar page - an
icondata
of the tab bar page - and a pagecontent, this is the page widget and it can be whatever widget you want it to be
styling
you can style the animatednavbar
with a variety of additional parameters
here’s an example
scaffold(
backgroundcolor: colors.blue,
body: animatednavbar(
borderradius: radius.circular(24),
color: colors.white,
padding: 8,
iconcolor: color(0xff0d1c2e),
inactiveiconcolor: color(0xff233b90),
backgroundcolor: colors.blue,
shadow: false,
textstyle: theme.of(context).texttheme.headline4,
pages: [
// first page
animatednavbarpage(
title: "home",
icon: icons.home,
inactiveicon: icons.home_outlined,
pagecontent: homepage(),
),
// second page
animatednavbarpage(
title: "map",
icon: icons.map,
inactiveicon: icons.map_outlined,
pagecontent: mappage(),
),
// third page
animatednavbarpage(
title: "user",
icon: icons.person,
inactiveicon: icons.person_outline,
pagecontent: userpage(),
),
],
),
);
contributions
please feel free to contribute to this project
you can download the project and work on your own version
if you found any bug, please open an issue.
if you fixed a bug or added a feature, please open a pull request.
examples
for a complete understandable project, refer to this repository.
Comments are closed.