Skip to main content

responsive_navigation_bar 8.0.0+1 copy "responsive_navigation_bar: ^8.0.0+1" to clipboard
responsive_navigation_bar: ^8.0.0+1 copied to clipboard

A responsive bottom navigation bar. Very beginner friendly. Feel free to contribute.

responsive_navigation_bar #

Version 8.x requires Flutter 3.47 or newer. Provide button text for screen-reader labels, including icon-only layouts. Selection is controlled by your app: update selectedIndex inside setState when onTabChange fires.

import 'package:material_ui/material_ui.dart';
import 'package:responsive_navigation_bar/responsive_navigation_bar.dart';

// In your State's build method, with `int selectedIndex = 0` as a field:
return Scaffold(
  body: Center(child: Text('Tab $selectedIndex')),
  bottomNavigationBar: ResponsiveNavigationBar(
    selectedIndex: selectedIndex,
    onTabChange: (index) => setState(() => selectedIndex = index),
    navigationBarButtons: const [
      NavigationBarButton(text: 'Home', icon: Icons.home),
      NavigationBarButton(text: 'Settings', icon: Icons.settings),
    ],
  ),
);

Getting Started #

Flutter 3.47+

dependencies:
  material_ui: ^1.11.0
  responsive_navigation_bar: ^8.0.0+1

Flutter 3.41–<3.47

dependencies:
  responsive_navigation_bar: ^7.0.0

Flutter 3.29–<3.41

dependencies:
  responsive_navigation_bar: ^6.2.1

The widget API is unchanged. The example also requires Flutter 3.47. Mobile host apps follow Flutter’s minimums (iOS 15 and Android API 24 on Flutter 3.47), or any higher minimum required by the app.

Example Code

Features #

  • Very easy to set up, beginner friendly

  • Everything is documented + you will be asked to add required values - the rest is optional (with sound null safety)

  • By default, text size, icon size and button padding are responsive (change size with screen size)

  • Set iconSize to control icon size independently (defaults to fontSize if not specified)

  • Optional: Beautiful gradient (backgroundGradient) for navigation bar and/or buttons (or solid colors)

  • Optional: Colored borders (border) for navigation bar and/or buttons

  • Optional: Change the opacity (backgroundOpacity) of the bar's solid background; gradients retain their own opacity

  • Optional: Blurred background (backgroundBlur) from the top of the navigation bar to the bottom of the screen

  • Optional: Separate border radius controls (borderRadius, buttonBorderRadius)

  • Optional: Control button spacing (buttonSpacing)

  • By default shows text on selected button, optionally show on inactive buttons too (showInactiveButtonText)

  • Only StatelessWidgets

  • How to make the bottomNavigationBar float above the Scaffold's body:

Scaffold(
  extendBody: true,
  body: SafeArea(bottom: false, ...),
  bottomNavigationBar: ...
  ...
)
  • Colors in the example GIFs below:
backgroundColor:
    Theme.of(context).brightness == Brightness.dark
        ? const Color(0xff3c3c3c)
        : const Color(0xffbebebe),
inactiveIconColor:
    Theme.of(context).brightness == Brightness.dark
        ? const Color(0xffaaaaaa)
        : const Color(0xff969696),

ResponsiveNavigationBar in Action #

With animation #

Screenrecording Screenrecording
Screenrecording Screenrecording

Without animation #

Screenrecording Screenrecording
Screenrecording Screenrecording

Todo #

  • Add feature requests
  • Merge your pull requests
83
likes
160
points
844
downloads

Documentation

API reference

Publisher

verified publisherachim.io

Weekly Downloads

A responsive bottom navigation bar. Very beginner friendly. Feel free to contribute.

Repository (GitHub)
View/report issues

Topics

#bottomnavigationbar #bottombar #responsive #ui

License

BSD-3-Clause (license)

Dependencies

flutter, material_ui

More

Packages that depend on responsive_navigation_bar