Bottom navigation bar with sliding clip effect.

Overview

Sliding Clipped Nav Bar

Instagram Badge Twitter Badge

Sliding Clipped Nav Bar

Design Credit

Toolbar icons animation by Cuberto

How to use?

API reference

barItems → List<BarItem>

  • List of bar items that shows horizontally, Minimum 2 and maximum 4 items.
    required

selectedIndex → int

  • Selected index of the bar items.
    required

iconSize → double

  • Size of all icons (inactive items), don't make it too big or will be clipped.
    optional [30]

activeColor → Color

  • Color of the selected item which indicate selected.
    required

inactiveColor → Color?

  • Inactive color of item, which actually color icons.
    nullable

onButtonPressed → OnButtonPressCallback

  • Callback when item is pressed.
    required

backgroundColor → Color

  • background color of the bar.
    optional [Colors.white]

Add SlidingClippedNavBar() as bottomNavigationBar of Scaffold() and body would be PageView() with NeverScrollableScrollPhysics() don't try to upate the seleted index from onPageChanged or will see some weird behaviour. You can use Stack() or AnimatedSwitcher() for custom page transition animation.

Keep that in mind this navigation menu is taller than normal for small screen it might cover more screen real estate.

Do and don't

  • Don't make icon size too big.

    • FontAwesomeIcons: 24
    • MaterialIcons: 30
  • Using SlidingClippedNavBar() when you want global active and inactive color.

 return Scaffold(
     
      body: PageView(
      physics: NeverScrollableScrollPhysics(),       
      controller: controller,
...
      ),
      bottomNavigationBar: SlidingClippedNavBar(
        backgroundColor: Colors.white,
        onButtonPressed: (index) {
          setState(() {
            selectedIndex = index;
          });
          controller.animateToPage(selectedIndex,
              duration: const Duration(milliseconds: 400),
              curve: Curves.easeOutQuad);
        },
        iconSize: 30,
        activeColor: Color(0xFF01579B),
        selectedIndex: selectedIndex,
        barItems: [
          BarItem(
            icon: Icons.event,
            title: 'Events',
          ),
          BarItem(
            icon: Icons.search_rounded,
            title: 'Search',
          ),
          BarItem(
            icon: Icons.bolt_rounded,
            title: 'Energy',
          ),
          BarItem(
            icon: Icons.tune_rounded,
            title: 'Settings',
          ),
        ],
      ),
    );
  • Using SlidingClippedNavBar.colorful() when you want to set individual item active & inactive color.
return Scaffold(
    
     body: PageView(
     physics: NeverScrollableScrollPhysics(),
     controller: controller,
...
     ),
     bottomNavigationBar: SlidingClippedNavBar.colorful(
       backgroundColor: Colors.white,
       onButtonPressed: (index) {
         setState(() {
           selectedIndex = index;
         });
         controller.animateToPage(selectedIndex,
             duration: const Duration(milliseconds: 400),
             curve: Curves.easeOutQuad);
       },
       iconSize: 30,
       selectedIndex: selectedIndex,
       barItems: [
         BarItem(
           icon: Icons.event,
           title: 'Events',
           activeColor: Colors.amber,
           inactiveColor: Colors.red,
         ),
         BarItem(
           icon: Icons.search_rounded,
           title: 'Search',
           activeColor: Colors.red,
           inactiveColor: Colors.green,
         ),
         BarItem(
           icon: Icons.bolt_rounded,
           title: 'Energy',
           activeColor: Colors.green,
           inactiveColor: Colors.blue,
         ),
         BarItem(
           icon: Icons.tune_rounded,
           title: 'Settings',
           activeColor: Colors.purple,
           inactiveColor: Colors.brown,
         ),
       ],
     ),
   );

Please consider giving me star and see my other repositories. This will motivate me to keep working.

You might also like...

Animation nav bar - Flutter Animated Navigation Bar

Animation nav bar - Flutter Animated Navigation Bar

Flutter Animated Navigation Bar Getting Started This project is a starting point

Dec 30, 2022

Fancy list loading effect or The Shimmer Effect in Flutter

Fancy list loading effect or The Shimmer Effect in Flutter

Shimmer Effect in Shimmer Effect is really cool placeholder effect that you can show when you are loading data in the form of a list. To do it in flut

Oct 18, 2022

The Ken Burns effect is a type of panning and zooming effect used in video production from still imagery.

The Ken Burns effect is a type of panning and zooming effect used in video production from still imagery.

KenBurns The Ken Burns effect is a type of panning and zooming effect used in video production from still imagery. First add to your dependencies: dep

Apr 28, 2022

In this project, we will design a travel app UI with a parallax effect for a unique scroll experience. You will learn how to create your own parallax effect without using external libraries.

In this project, we will design a travel app UI with a parallax effect for a unique scroll experience. You will learn how to create your own parallax effect without using external libraries.

Travel App UI In this part, we will design a travel app UI with a parallax effect for a unique scroll experience. You will learn how to create your ow

Dec 5, 2022

Flutter circle bottom bar by animation

Flutter circle bottom bar by animation

Animation circle bottom bar Flutter circle bottom bar by animation how to use: 1. add dependencies to pubspec.yaml: circle_bottombar: ^1.1.1 2. create

Oct 29, 2022

Expandable bottom app bar widget for Flutter SDK

Expandable bottom app bar widget for Flutter SDK

Expandable bottom app bar widget for Flutter SDK

Dec 28, 2022

Notched Bottom Tab Bar Example using Flutter Framework

Notched Bottom Tab Bar Example using Flutter Framework

bottom_tab_bar Notched Bottom Tab Bar Example using Flutter Framework Getting Started Flutter tutorial explaining how to create a notched shaped botto

Dec 6, 2022

Doctor Consultation App in Flutter containing splash screen on boarding screen Routing state management Dash board Bottom navigation Decorated Drawer and Doctors Screen in the last.

Doctor Consultation App in Flutter containing splash screen on boarding screen  Routing  state management Dash board Bottom navigation Decorated Drawer and Doctors Screen in the last.

Online doctor Consultation App UI in Flutter Doctor Consultation App UI in Flutter Visit Website Features State Management Navigation Bar Responsive D

Jan 1, 2023

A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier.

A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier.

Draggable Home A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier! Based on the Scaffold and Sliver. Us

Dec 12, 2022
Comments
  • Added some features

    Added some features

    • specify bar height
    • specify custom box decoration of bar
    • specify custom textStyle
    • specify custom text fontSize
    • fix bug in preselection of different index. I can explain better if required
    opened by asterd 7
  • Fix : smaller icon will not hide

    Fix : smaller icon will not hide

    Hey friend, I'm using your beautiful widget with Feather_icons and when the text title appears the Icon does not hide completely, so I made this change. Screenshot_1637660242 Screenshot_1637660297

    Please Accept my pull Request if you like. Thank You!

    opened by samtheory 2
  • Feature: inactiveColor and activeColor per item

    Feature: inactiveColor and activeColor per item

    Solves: #1. Very small change to support this feature.

    NOTE: I did not test this at all as I did the changes directly from the GitHub editor, but everything should be covered.

    opened by Aquaterion 1
Owner
Watery Desert
Flutter mobile app developer.
Watery Desert
Custom bottom bar - A bottom tool bar that can be swiped left or right to expose more tools.

custom_bottom_bar A bottom tool bar that can be swiped left or right to expose more tools. usage Create your custom bottom bars with up to four custom

null 4 Jan 26, 2020
A custom navigation bar with bubble click effect in Flutter

custom_navigation_bar A custom navigation bar with bubble click effect. Overview This project is inspired by this post from Dribbble and The Boring Fl

chaoxiang wen 194 Jan 2, 2023
A custom bottom navigation bar with box animation for flutter

A custom bottom navigation bar with box animation. This is inspired from some of the earlier designs, but in a more simplified and yet exiting way. De

SHIVAM SONI 1 Jul 31, 2022
New trick on how to create your own custom icons in flutter with bottom bar navigation

Customized Bottom Navigation Bar in Flutter | Tech With Sam Customized Bottom Navigation Bar in Flutter - Watch on youtube ✌   App Preview App Screens

Samuel Adekunle 10 Oct 26, 2022
This is repository for Spin Circle Bottom Navigation Bar Package for Flutter

Spin Circle Bottom Bar An easy to implement Spin Circle Bottom Navigation Bar for Flutter Applications. Current Features Initial Release for Spin Circ

Paras Jain 79 Dec 22, 2022
simple flutter bottom navigation bar widget

bmnav A very flexible Flutter implementation of the Bottom Navigation Bar. Get Started Add bmanv to your pubspec.yaml file: dependencies: bmnav: ^0.

Edwin 21 Oct 8, 2022
A 3D Bottom Navigation Bar in Flutter

flip_box_bar A 3D BottomNavigationBar inspired by Dribbble design by Dannniel [https://dribbble.com/shots/4811135-Tab-Bar-Cube-Interaction]. Demo Exam

Deven Joshi 258 Nov 19, 2022
Playful and customizable bottom navigation bar for Flutter

rolling_nav_bar A bottom nav bar with layout inspired by this design and with heavily customizable animations, colors, and shapes. Getting Started To

Craig Labenz 117 Dec 22, 2022
A fancy animated bottom navigation bar 💫.

Stacky_bottom_nav_bar A fancy animated bottom navigation bar. Preview Default Light Mode Default Dark Mode ⚠️ IMPORTANT: when adding this widget don’t

null 5 Oct 23, 2022
Custom Shaped Bottom Navigation Bar in Flutter

CustomShapedBottomBar Custom Shaped Bottom Navigation Bar in Flutter **Usage: ** Add CustomPaint Widget to use this Painter class like this: C

Shraddha Sojitra 5 May 6, 2022