Skip to main content

native_glass_navbar 2.0.0 copy "native_glass_navbar: ^2.0.0" to clipboard
native_glass_navbar: ^2.0.0 copied to clipboard

PlatformiOS

A Flutter plugin that brings the native iOS Liquid Glass style navigation bar to your Flutter apps.

native_glass_navbar #

A Flutter plugin that brings the native iOS Liquid Glass style navigation bar to your Flutter apps.

This package uses platform views and method channels to render the actual native iOS UITabBar. This means no more of that uncanny valley effect that you often get with custom Flutter implementations.

The Dart implementation uses Flutter's official standalone material_ui package so Material and Cupertino apps share the same decoupled theme state.

Demos
#

output output-items-bg

Features #

  • Native look and feel: Probably because it is native 😉.
  • Dark Mode & Theming: Automatically matches system themes and uses your app's primary color.
  • Action Button: Add a floating action button for your main app actions.
  • Tab Badges: Show and update native badges on individual tabs.
  • SF Symbols: Use any SF Symbol for icons.
  • Fallback Support: Optionally define a fallback widget for Android or older iOS versions.

Installation #

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

dependencies:
    native_glass_navbar: ^2.0.0

Requirements #

  • Build iOS apps with Xcode 27 or later.
  • Use Flutter 3.44 or later and Dart 3.12 or later.
  • The example uses Flutter 3.47.4, pinned with FVM, and Swift Package Manager.

Usage #

Import the package:

import 'package:native_glass_navbar/native_glass_navbar.dart';

Basic Implementation #

NativeGlassNavBar(
  currentIndex: _currentIndex,
  onTap: (index) {
    setState(() {
      _currentIndex = index;
    });
  },
  tabs: const [
    NativeGlassNavBarItem(
      label: 'Home',
      symbol: 'house',
      selectedSymbol: 'house.fill',
    ),
    NativeGlassNavBarItem(label: 'Search', symbol: 'magnifyingglass'),
    NativeGlassNavBarItem(label: 'Settings', symbol: 'gear'),
  ],
)

With Action Button #

You can add a action button (e.g., for a "New Post" action). Note that when an action button is present, the maximum number of tabs is 4.

yes I'm aware this is not the recommended design pattern but I like it soooooooo...

NativeGlassNavBar(
  currentIndex: _currentIndex,
  onTap: (index) => setState(() => _currentIndex = index),
  actionButton: TabBarActionButton(
    symbol: 'plus',
    onTap: () {
      print('Action button tapped!');
    },
  ),
  tabs: const [
    NativeGlassNavBarItem(label: 'Home', symbol: 'house'),
    NativeGlassNavBarItem(label: 'Profile', symbol: 'person'),
  ],
)

With Tab Badges #

Set badgeValue on a tab item. Rebuild the bar with a new value to update the badge; use null to hide it.

NativeGlassNavBarItem(
  label: 'Inbox',
  symbol: 'tray.fill',
  badgeValue: unreadCount == 0 ? null : '$unreadCount',
)

Theme Integration #

Version 2 uses Flutter's standalone material_ui theme lookup. It automatically follows both material_ui MaterialApp themes and cupertino_ui CupertinoApp themes, including live light/dark changes. No compatibility bridge or explicit brightness parameter is required.

Apps that still use Flutter's legacy package:flutter/material.dart or package:flutter/cupertino.dart should remain on native_glass_navbar 1.x until they migrate to the standalone UI packages.

Handling Unsupported Platforms #

Since this plugin relies on native iOS APIs, it will not render the glass effect on Android or older iOS versions. You can provide a fallback widget (like a standard BottomNavigationBar) for these cases.

NativeGlassNavBar(
  // ... other properties
  fallback: BottomNavigationBar(
    currentIndex: _currentIndex,
    onTap: (index) => setState(() => _currentIndex = index),
    items: const [
      BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
      BottomNavigationBarItem(icon: Icon(Icons.settings), label: 'Settings'),
    ],
  ),
)

API Reference #

NativeGlassNavBar #

Parameter Type Description
tabs List<NativeGlassNavBarItem> List of tabs to display. Max 5 (or 4 with action button).
currentIndex int The index of the currently selected tab.
onTap ValueChanged<int> Callback when a tab is selected.
actionButton TabBarActionButton? Optional action button.
tintColor Color? Color of the selected item. Defaults to Theme.of(context).colorScheme.primary.
fallback Widget? Widget to display if the platform is not supported.

NativeGlassNavBarItem #

Parameter Type Description
label String Text label for the tab.
symbol String SF Symbol name for the normal icon (e.g., 'house').
selectedSymbol String? Optional SF Symbol for the selected icon (e.g., 'house.fill'). Defaults to symbol.
badgeValue String? Native badge text. null hides the badge.
57
likes
150
points
6.38k
downloads

Documentation

API reference

Publisher

verified publishertnitish.com

Weekly Downloads

A Flutter plugin that brings the native iOS Liquid Glass style navigation bar to your Flutter apps.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, material_ui

More

Packages that depend on native_glass_navbar

Packages that implement native_glass_navbar