BottomNavigationItem constructor

BottomNavigationItem({
  1. Color? color,
  2. String? title,
  3. Duration? duration,
  4. required Widget activeIcon,
  5. required Widget inActiveIcon,
  6. required TickerProvider vSync,
})

Animation Object to design and the animation as you wish.

Implementation

//Animation<double> _animation;

BottomNavigationItem({
  Color? color,
  String? title,
  Duration? duration,
  required Widget activeIcon,
  required Widget inActiveIcon,
  required TickerProvider vSync,
})  :
      controller = AnimationController(
        vsync: vSync,
        duration: (duration != null && !duration.isNegative)
            ? duration
            : kThemeAnimationDuration,
        reverseDuration: duration,
      ),
      item = BottomNavigationBarItem(
        icon: inActiveIcon,
        activeIcon: activeIcon,
        label: title != null && title.isNotEmpty ? title : '',
        backgroundColor: color ?? Colors.white70,
      ) {
  /*_animation =*/
      controller.drive(
    CurveTween(
      curve: const Interval(0.1, 1.0, curve: Curves.fastOutSlowIn),
    ),
  );
}