liquid_navbar 2.0.7
liquid_navbar: ^2.0.7 copied to clipboard
A customizable liquid-glass floating navbar with draggable indicator and parallax pages.
LiquidGlass NavBar 🌊 #
A beautiful, customizable liquid-glass floating navigation bar for Flutter with a draggable indicator and parallax page transitions.
https://github.com/user-attachments/assets/1d4dda9d-4da8-476f-ad0c-b1ee8d4ffd93
✨ Features #
- Liquid Glass Design: Beautiful glasomorphic navigation bar with liquid glass effects
- Draggable Indicator: Smooth, draggable indicator that snaps to navigation items
- Parallax Pages: Subtle parallax effect when navigating between pages
- Adaptive Layout: Automatically adjusts to different screen sizes and item counts
- Customizable: Full control over colors, sizes, spacing, and styling
- State Management: Built with Riverpod for efficient state management
- Responsive: Fully adaptive to different screen sizes using standard Flutter layout
https://github.com/user-attachments/assets/d2f8fa04-39fd-4add-9aed-670734aa0a35
📦 Installation #
Add this to your package's pubspec.yaml file:
dependencies:
liquid_navbar: ^2.0.3
Then run:
flutter pub get
🚀 Quick Start #
Basic Usage #
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:liquid_navbar/liquid_navbar.dart';
void main() {
runApp(
const ProviderScope(
child: MyApp(),
),
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: BottomNavScaffold(
pages: [
HomePage(),
SearchPage(),
ProfilePage(),
],
icons: [
Icon(Icons.home),
Icon(Icons.search),
Icon(Icons.person),
],
labels: [
'Home',
'Search',
'Profile',
],
),
);
}
}
Advanced Customization #
BottomNavScaffold(
pages: myPages,
icons: myIcons,
labels: myLabels,
navbarHeight: 80,
indicatorWidth: 80,
bottomPadding: 25,
selectedColor: Colors.blue,
unselectedColor: Colors.grey.shade400,
horizontalPadding: 15,
)
IMPORTANT NOTE: When changing visual parameters such as the number of icons, padding, or navbar height, you MUST perform a Hot Restart (or full app restart) for the indicator position to be recalculated correctly. Hot Reload is sufficient for color changes, but layout changes require a restart.
🎨 Customization Options #
BottomNavScaffold Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
pages |
List<Widget> |
Required | List of pages to display |
icons |
List<Widget> |
Required | List of icons for navbar items |
labels |
List<String> |
Required | List of labels for navbar items |
navbarHeight |
double |
70 |
Height of the navigation bar |
indicatorWidth |
double |
70 |
Base width of the draggable indicator |
bottomPadding |
double |
20 |
Padding from bottom of screen |
selectedColor |
Color |
Colors.amber |
Color for selected items |
unselectedColor |
Color |
Colors.grey |
Color for unselected items |
horizontalPadding |
double |
10 |
Horizontal padding for items |
NavbarItemWidget Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
icon |
Widget |
Required | Icon to display |
label |
String |
Required | Label text |
isSelected |
bool |
Required | Whether item is selected |
onTap |
VoidCallback |
Required | Callback when tapped |
selectedIconSize |
double |
28 |
Size of selected icon |
unselectedIconSize |
double |
24 |
Size of unselected icon |
selectedFontSize |
double |
12 |
Font size when selected |
unselectedFontSize |
double |
10 |
Font size when unselected |
selectedColor |
Color |
Colors.amber |
Color when selected |
unselectedColor |
Color |
Colors.grey |
Color when unselected |
🏗️ Architecture #
The package is structured with modular, reusable components:
BottomNavScaffold: Main scaffold widget that orchestrates pages and navbarNavbarWidget: Container widget for the navigation barNavbarItemWidget: Individual navigation item with icon and labelNavbarDraggableIndicator: Draggable liquid glass indicatorNavbarBackground: Glasomorphic background containerNavbarProviders: Riverpod state management for navbar state
🛠️ Dependencies #
liquid_glass_renderer: ^0.2.0-dev.4- Liquid glass effectsflutter_riverpod: ^3.0.3- State management
📱 Platform Support #
- ✅ iOS
- ✅ Android
- ✅ Web
- ✅ macOS
- ✅ Windows
- ✅ Linux
🤝 Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License #
This project is licensed under the MIT License - see the LICENSE file for details.
👤 Author #
Zyad Khedr
- Email: [email protected]
- GitHub: @ZyadWKhedr
🌟 Show Your Support #
Give a ⭐️ if this project helped you!
📝 Changelog #
See CHANGELOG.md for details on updates and version history.