A Flutter package for easy implementation of curved navigation bar

Overview

curved_navigation_bar

pub package

A Flutter package for easy implementation of curved navigation bar.

Gif

Add dependency

dependencies:
  curved_navigation_bar: ^1.0.1 #latest version

Easy to use

Scaffold(
  bottomNavigationBar: CurvedNavigationBar(
    backgroundColor: Colors.blueAccent,
    items: <Widget>[
      Icon(Icons.add, size: 30),
      Icon(Icons.list, size: 30),
      Icon(Icons.compare_arrows, size: 30),
    ],
    onTap: (index) {
      //Handle button tap
    },
  ),
  body: Container(color: Colors.blueAccent),
)

Attributes

items: List of Widgets
index: index of NavigationBar, can be used to change current index or to set initial index
color: Color of NavigationBar, default Colors.white
buttonBackgroundColor: background color of floating button, default same as color attribute
backgroundColor: Color of NavigationBar's background, default Colors.blueAccent
onTap: Function handling taps on items
animationCurve: Curves interpolating button change animation, default Curves.easeOutCubic
animationDuration: Duration of button change animation, default Duration(milliseconds: 600)
height: Height of NavigationBar, min 0.0, max 75.0
letIndexChange: Function which takes page index as argument and returns bool. If function returns false then page is not changed on button tap. It returns true by default\

Change page programmatically

 //State class
  int _page = 0;
  GlobalKey<CurvedNavigationBarState> _bottomNavigationKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        bottomNavigationBar: CurvedNavigationBar(
          key: _bottomNavigationKey,
          items: <Widget>[
            Icon(Icons.add, size: 30),
            Icon(Icons.list, size: 30),
            Icon(Icons.compare_arrows, size: 30),
          ],
          onTap: (index) {
            setState(() {
              _page = index;
            });
          },
        ),
        body: Container(
          color: Colors.blueAccent,
          child: Center(
            child: Column(
              children: <Widget>[
                Text(_page.toString(), textScaleFactor: 10.0),
                ElevatedButton(
                  child: Text('Go To Page of index 1'),
                  onPressed: () {
                    //Page change using state does the same as clicking index 1 navigation button
                    final CurvedNavigationBarState? navBarState =
                        _bottomNavigationKey.currentState;
                    navBarState?.setPage(1);
                  },
                )
              ],
            ),
          ),
        ));
  }
Comments
  • How to make the background color transparent

    How to make the background color transparent

    Please how can someone make the Navigation bar background color to be transparent?

    I have tried Colors.transparent and .withOpacity(0.0) but they don't work.

    Please how can I solve this?

    Something like this: transparent-nav

    opened by kosytedy 11
  • Background Color not Transparent

    Background Color not Transparent

    Hi, i tried all answers in #31 but did not work any answers that's why i am creating a new issue that the background of nav bar not changed here is my code:

              Scaffold(
            extendBody: true,  // here is extendbody set
            bottomNavigationBar: CurvedNavigationBar(
              color: Color(int.parse('$newColor')),
              backgroundColor: Colors.transparent, // here is background color set
              key: _bottomsKey,
              height: 50,
              items: [
          // here those nav screen shown according to list 
            ]
            ),
            body: WillPopScope(
                onWillPop: _onWillPop, child: resultScreens[_page]),
          );
    

    kindly look into this and guide me if i am wrong this is my navbar class.

    opened by itsdani121 9
  • Curved Navigation bar not responding to theme change

    Curved Navigation bar not responding to theme change

    WhatsApp Video 2020-06-22 at 11 13 11 PM

    Focus on the Home icon after the theme is changed.

    Here's the code of switch (used to change the theme):

    child: Switch(
                      activeColor: Theme.of(context).accentColor,
                      value: _darkTheme,
                      onChanged: (val) {
                        setState(() {
                          _darkTheme = val;
                        });
                        onThemeChanged(val, themeNotifier);
                      },
                    ),
    

    theme notifier and dark theme is initialised as :

    var _darkTheme = true;
    final themeNotifier = Provider.of<ThemeNotifier>(context);
    

    And this is the code for CurvedNavigationBar:

    bottomNavigationBar: CurvedNavigationBar(
                  color: Theme.of(context).bottomAppBarColor,
                  backgroundColor: Theme.of(context).scaffoldBackgroundColor,
                  index: _selectedPage,
                  onTap: (index) {
                    bottomTapped(index);
                  },
                  items: [
                    Tooltip(
                      message: 'Dashboard',
                      child: Icon(
                        FontAwesomeIcons.home,
                        size: 20.0,
                        color: Theme.of(context).accentColor,
                        //color: Colors.black,
                      ),
                    ),
                    Tooltip(
                      message: 'My Requests',
                      child: Icon(
                        Icons.format_list_bulleted,
                        size: 20.0,
                        color: Theme.of(context).accentColor,
                      ),
                    ),
                    Tooltip(
                      message: 'Messages',
                      child: Icon(
                        _selectedPage == 2 ? Icons.chat_bubble : Icons.chat_bubble_outline,
                        size: 20.0,
                        color: Theme.of(context).accentColor,
                      ),
                    ),
                    Tooltip(
                      message: 'Notifications',
                      child: Icon(
                        _selectedPage == 3 ? Icons.notifications : Icons.notifications_none,
                        size: 20.0,
                        color: Theme.of(context).accentColor,
                      ),
                    ),
                    Tooltip(
                      message: 'Profile',
                      child: Icon(
                        _selectedPage == 4 ? Icons.person : Icons.person_outline,
                        size: 20.0,
                        color: Theme.of(context).accentColor,
                      ),
                    ),
                  ],
                ),
    
    opened by Deepanshu-Rohilla 8
  • Is it possible to use the transparent background?

    Is it possible to use the transparent background?

    Hi! I try to set a background transparent but it not works.

    image

    I wish there was the possibility to set the background behind the selected button transparency.

    I am attaching the reference git to the app.

    https://github.com/EliaTolin/StatusVaccini

    opened by EliaTolin 6
  • Cant compile for Windows.

    Cant compile for Windows.

    /C:/flutter/.pub-cache/hosted/pub.dartlang.org/curved_navigation_bar-0.3.4/lib/curved_navigation_bar.dart(95,9): error GBF4691A2: No named parameter with the name 'overflow'. [C:\Programming\Flutter\adminbscit\build\windows\flutter\flutter_assemble.vcxproj]

    opened by Shiba-Kar 6
  • How to animate based on the swiping movements of the tabbarview?

    How to animate based on the swiping movements of the tabbarview?

    As we know there are two ways to navigate tabBarView. One is by clicking the tab handle and one is by swipping. With your package i am able to click on the icon to navigate. But how do i swipe to navigate while animating the curve navigation bar icons?

    opened by momoDragon 6
  • Badge content not updating

    Badge content not updating

    It was working fine when using BottomNavigationBar but when I switched to this, the badge content is not updating in realtime.

    Badge( badgeColor: CustomColor.themeSecondary, shape: BadgeShape.circle, borderRadius: BorderRadius.circular(100), child: Icon(Icons.shopping_cart, size: 25, color: widget.selectBottomNavigationIndex == 2 ? Colors.white : CustomColor.themeColor ), badgeContent: Text(cart.toString(), style: TextStyle(color: Colors.white))),

    opened by Kshitiz-Rimal 5
  • CurvedNavigationBarState bug

    CurvedNavigationBarState bug

    Compiler message: ../../.pub-cache/hosted/pub.dartlang.org/curved_navigation_bar-0.3.2/lib/curved_navigation_bar.dart:95:19: Error: The getter 'Overflow' isn't defined for the class 'CurvedNavigationBarState'. - 'CurvedNavigationBarState' is from 'package:curved_navigation_bar/curved_navigation_bar.dart' ('../../.pub-cache/hosted/pub.dartlang.org/curved_navigation_bar-0.3.2/lib/curved_navigation_bar.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'Overflow'. overflow: Overflow.visible,

    opened by heshesh2010 5
  • How change the bottom-bar-index on page change?

    How change the bottom-bar-index on page change?

    Great job, looks great!

    I just tried the CurvedNavigationBar. I stuck with one question/problem: I use Pageview to show the content. When you swipe to another page, I want to change the selected bottombar also, but there is only a initialIndex. How can I change the selected bottombaritem afterwards?

    enhancement 
    opened by LiveLikeCounter 5
  • backgroundColor should have transparent color

    backgroundColor should have transparent color

    I think if anyhow we can do backgroundColor to transparent then it automatically adapts to screen background color. I tried to assign a backgroundColor to transparent but it still white please implement it.

    Screenshot (33)_LI

    opened by ShashankSirmour 5
  • how to add to the project ...

    how to add to the project ...

    sorry for this really basic question but im new to flutter and dont know how to add it to my project. in first place for adding the dependencies i have this error : Error on line 14, column 3 of pubspec.yaml: A package may not list itself as a dependency.

    second where to add that Scaffold(...)

    and third i dont know how to use it in another project ...

    i wish you guys can help me with comments or a link to a tutorial thank you

    opened by MojtabaTavakkoli 4
  • BottomAppBar shape feature

    BottomAppBar shape feature

    can we have this feature please

    BottomAppBar(
            shape: const CircularNotchedRectangle(),
    

    so that we can have this Screenshot (1) Screenshot (2) The second screenshot is what i want to achieve

    opened by SOG-web 0
  • Limiting the width & Removing the side leftovers from the menu

    Limiting the width & Removing the side leftovers from the menu

    Limit the maximum size of the menu. with a new attribute maxWidth if the screen is less than the maxWidth value, the menu takes the screen's Width value

    image

    Removing the side leftovers from the menu. Removing the side leftovers from the menu, because after limiting it, it creates leftovers on the sides

    opened by andre-ab 0
Owner
null
A Flutter implementation of a customizable navigation bar with animations.

A heavily customizable bottom navigation bar with some animation modifiers.

null 1 Jun 17, 2022
Transparent Android system navigation bar with Flutter and FlexColorScheme package.

Sysnavbar with FlexColorScheme Transparent Android system navigation bar with Flutter and FlexColorScheme. FlexColorScheme V4 Notice If you are using

Rydmike 12 Oct 21, 2022
Fast code and awesome design-ui for flutter navigation bar

Flutter-awesome-bottom-navigation-bar ??‍?? Fast code and awesome design-ui for flutter navigation bar ?? Getting Started # First you need to add flas

Hmida 20 Nov 22, 2022
Custom Bottom navigation bar on Flutter.

Intro Custom Bottom navigation bar on Flutter. The updated one Support : Null safety & Support 9 items on Tabs & Some Color, Size, Effects and font cu

Ihab Zaidi 2 Oct 8, 2021
Customized 🚀 Bottom Navigation Bar Using Flutter 🐦

Customized ?? Bottom Navigation Bar Using Flutter ??

AmirHossein Bayat 3 Dec 7, 2022
Persistent Bottom Navigation Bar

Persistent Bottom Navigation Bar A persistent/static bottom navigation bar for Flutter. NOTE: Those migrating from pre 2.0.0 version should check the

Bilal Shahid 421 Dec 20, 2022
A bottom navigation bar that you can customize with the options you need, without any limits.

Bottom Personalized Dot Bar A bottom navigation bar that you can customize with the options you need, without any limits. You can also customize the a

null 103 Oct 20, 2022
A Custom Extended Scaffold with Expandable and Floating Navigation Bar

Custom Extended Scaffold Custom Flutter widgets that makes Bottom Navigation Floating and can be expanded with much cleaner a

Ketan Choyal 139 Dec 10, 2022
Flutter Flows made easy! A Flutter package which simplifies navigation flows with a flexible, declarative API.

Flutter Flows made easy! Usage Define a Flow State The flow state will be the state which drives the flow. Each time this state changes, a new navigat

Felix Angelov 337 Dec 31, 2022
A simple and easy to learn declarative navigation framework for Flutter, based on Navigator 2.0.

A simple and easy to learn declarative navigation framework for Flutter, based on Navigator 2.0 (Router). If you love Flutter, you would love declarat

Zeno Nine 20 Jun 28, 2022
Easy-to-use Navigator 2.0 router for web, mobile and desktop. URL-based routing, simple navigation of tabs and nested routes.

Routemaster Hello! Routemaster is an easy-to-use router for Flutter, which wraps over Navigator 2.0... and has a silly name. Features Simple declarati

Tom Gilder 291 Jan 3, 2023
A flutter navigation package

Create By Me(Agalaba Ifeanyi Precious) go Navigate Navigate Like a pro from one Screen to another Using go navigate. go_Navigate provide you the abili

Agalaba Ifeanyi Precious 2 Oct 11, 2021
A Flutter package for easily implementing Material Design navigation transitions.

Morpheus A Flutter package for easily implementing Material Design navigation transitions. Examples Parent-child transition You can use MorpheusPageRo

Sander R. D. Larsen 186 Jan 7, 2023
Elegant abstraction for complete deep linking navigation in Flutter

Flutter Deep Link Navigation Provides an elegant abstraction for complete deep linking navigation in Flutter. This package only provides deep linking

Dennis Krasnov 64 Dec 27, 2022
flutter bottom navigation bat project

bottom_navigation A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you starte

Danushan Ravendran 3 Sep 23, 2021
Flutter Material Design Navigation Drawer Menu

navigation_drawer_menu Flutter Material Design Navigation Drawer Menu Navigation drawer is a common UI pattern for adaptive menus. The Material Design

Christian Findlay 9 Dec 12, 2022
Flutter custom BottomBar Navigation Widget

bottom_bar_with_sheet ?? Non-standard way to use more space of screens in your application ?? ?? Custom bottom Sheet under Bottom Navigation Bar ?? ??

Stanislav Ilin 305 Dec 23, 2022
Simple but powerfull Flutter navigation with riverpod and Navigator 2.0

Riverpod navigation If you are interested in the motivation why the package was created and a detailed description of what problems it solves, read th

pavelpz 20 Dec 13, 2022
Fluro is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions.

English | Português The brightest, hippest, coolest router for Flutter. Features Simple route navigation Function handlers (map to a function instead

Luke Pighetti 3.5k Jan 4, 2023