DEV Community

Cover image for FloatyNavBar: Elevate Your Flutter App's Navigation
Mustafa Ibrahim
Mustafa Ibrahim

Posted on

FloatyNavBar: Elevate Your Flutter App's Navigation

In the world of mobile app development, user interface and navigation play crucial roles in creating engaging and intuitive experiences. As Flutter continues to grow in popularity, developers are always on the lookout for tools that can help them create unique and functional designs. Today, I'm excited to introduce FloatyNavBar, a new Flutter package that brings a fresh perspective to in-app navigation.

What is FloatyNavBar?

FloatyNavBar is a customizable floating navigation bar for Flutter applications. It provides a sleek and interactive way to navigate between tabs while offering an optional action button for additional functionality. With smooth animations and a variety of customization options, FloatyNavBar allows developers to create navigation experiences that stand out.

Key Features

  1. Customizable Tabs: Each tab can be fully customized with its own icon, title, and colors.
  2. Floating Action Button: Add a unique action button to each tab for quick access to important features.
  3. Smooth Animations: Enjoy fluid transitions between tabs and when showing/hiding the action button.
  4. Multiple Shapes: Choose from Circle, Rectangle, or Squircle shapes for your navigation bar.
  5. Easy Integration: Designed to work seamlessly with existing Flutter projects.

How to Use FloatyNavBar

Getting started with FloatyNavBar is straightforward. First, add the package to your pubspec.yaml:

dependencies:
  floaty_nav_bar: ^1.0.0

Enter fullscreen mode Exit fullscreen mode

Then, import it in your Dart file:

import 'package:floaty_nav_bar/floaty_nav_bar.dart';

Enter fullscreen mode Exit fullscreen mode

Now, you're ready to use FloatyNavBar in your app. Here's a basic example:

FloatyNavBar(
  selectedTab: _selectedIndex,
  tabs: [
    FloatyTab(
      isSelected: _selectedIndex == 0,
      title: 'Home',
      icon: Icon(Icons.home),
      onTap: () => setState(() => _selectedIndex = 0),
    ),
    FloatyTab(
      isSelected: _selectedIndex == 1,
      title: 'Search',
      icon: Icon(Icons.search),
      onTap: () => setState(() => _selectedIndex = 1),
      floatyActionButton: FloatyActionButton(
        icon: Icon(Icons.add),
        onTap: () {
          // Add action for search tab
        },
      ),
    ),
    FloatyTab(
      isSelected: _selectedIndex == 2,
      title: 'Profile',
      icon: Icon(Icons.person),
      onTap: () => setState(() => _selectedIndex = 2),
    ),
  ],
)

Enter fullscreen mode Exit fullscreen mode

Customization Options

FloatyNavBar offers a wide range of customization options to fit your app's design:

  1. Tab Appearance: Customize colors, icons, and text styles for selected and unselected states.
  2. Action Button: Modify size, colors, and elevation of the floating action button.
  3. Navigation Bar Shape: Choose between Circle, Rectangle, and Squircle shapes.
  4. Animations: Adjust animation durations and curves to match your app's feel.

Why Choose FloatyNavBar?

  1. Unique Design: Stand out from standard bottom navigation bars with a floating, animated design.
  2. Flexibility: Adapt the navigation bar to fit various app styles and themes.
  3. Enhanced Functionality: The per-tab floating action button adds an extra layer of interactivity.
  4. Developer-Friendly: Easy to implement and customize, with clear documentation.

Conclusion

FloatyNavBar brings a fresh and modern approach to in-app navigation for Flutter applications. Whether you're building a new app or looking to revamp an existing one, FloatyNavBar offers the flexibility and style to elevate your user interface.

Give FloatyNavBar a try in your next Flutter project and see how it can transform your app's navigation experience. The package is open-source and available on pub.dev. We welcome contributions and feedback from the community to make FloatyNavBar even better.

Happy coding, and may your apps float to new heights with FloatyNavBar!

Get Started with FloatyNavBar

Ready to elevate your app's navigation? Here's where you can find FloatyNavBar and connect with the developer:

About the Developer

FloatyNavBar is developed and maintained by Mustafa Ibrahim. If you'd like to connect or see more of Mustafa's work:

Feel free to reach out with any questions, suggestions, or contributions. Let's make Flutter development even more exciting together!

Top comments (0)