Search packages, repositories and app categories

Package detailsv1.0.3

bottom_navigation_badge

BottomNavigationBadge is a Flutter widget developed by westdabestdb that allows developers to add notification badges to bottom navigation bar items.

30-day downloads
208
Likes
63
Pub points
40

Install package

flutter pub add bottom_navigation_badge

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

BottomNavigationBadge is a Flutter widget that enables developers to display notification badges on bottom navigation bar items. Created by westdabestdb, it enhances user experience by visually indicating unread messages or updates directly within the navigation interface. The package integrates seamlessly with existing bottom navigation setups and supports custom styling for badge appearance. It is lightweight and designed specifically for Flutter applications requiring intuitive notification indicators in bottom navigation bars.

Use cases

  • Displaying unread message counts
  • Highlighting pending actions
  • Enhancing app notification visibility
  • Improving user engagement through visual cues
  • Customizing badge appearance per item

Key features

  • Easy integration with BottomNavigationBar
  • Support for custom badge colors and text
  • Lightweight and focused functionality
  • Dynamic badge updates
  • Simple API for badge management

Suitable for

  • Mobile apps with bottom navigation
  • Apps needing real-time notifications
  • Developers seeking minimalistic badge solutions
  • UI-focused Flutter projects
  • Applications with multiple navigation tabs

Considerations

  • Limited to bottom navigation context
  • No built-in animation support
  • Requires manual badge state management
  • Not suitable for complex badge layouts
  • Depends on parent BottomNavigationBar structure

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

bottom_navigation_badge / BottomNavigationBadge

BottomNavigationBadge is a Flutter class developed by westdabestdb.

Getting Started

Add this to your package's pubspec.yaml file:

...
dependencies:
  bottom_navigation_badge: ^1.0.3

Now in your Dart code, you can use:

import 'package:bottom_navigation_badge/bottom_navigation_badge.dart';

Usage

Initialize the badger. Isn't it a nice variable name lol 😁

BottomNavigationBadge badger = new BottomNavigationBadge(
  backgroundColor: Colors.red,
  badgeShape: BottomNavigationBadgeShape.circle,
  textColor: Colors.white,
  position: BottomNavigationBadgePosition.topRight,
  textSize: 8);

Create a list of BottomNavigationBarItems

List<BottomNavigationBarItem> items = [
  BottomNavigationBarItem(icon: Icon(Icons.home), title: Text("Home")),
  BottomNavigationBarItem(icon: Icon(Icons.notifications), title: Text("Notifications")),
  BottomNavigationBarItem(icon: Icon(Icons.face), title: Text("Profile"))
];

Add badge to index with content "1"

setState(() {
  items = badger.setBadge(items, "1", index);
});

Remove the badge at index

setState(() {
  items = badger.removeBadge(items, index);
});

Remove all the badges

setState(() {
  items = badger.removeAll(items);
});

Categories

Source repository

Projects using this package

No data available yet.