liquid_glass_nav 1.0.1
liquid_glass_nav: ^1.0.1 copied to clipboard
A beautiful, highly customizable bottom navigation bar with liquid glass (glassmorphism) effect. Features smooth animations, haptic feedback, badges, and accessibility support.
Liquid Glass Nav πβ¨ #
A beautiful, highly customizable bottom navigation bar with liquid glass (glassmorphism) effect for Flutter. Create stunning iOS-style navigation bars with smooth animations, haptic feedback, badges, and much more!
πΈ Preview #
Features β¨ #
- π¨ Stunning Glassmorphism Effect - Beautiful frosted glass appearance with customizable blur
- π― Fully Customizable - Colors, icons, labels, sizes, gradients, and more
- π± iOS-Style Design - Rounded corners and smooth animations
- β‘ High Performance - Optimized with BackdropFilter
- π Multiple Animation Types - Scale, Slide, Rotate, and Fade transitions
- π³ Haptic Feedback - Built-in haptic feedback support (Light, Medium, Heavy, Selection)
- π Badge Support - Show notification badges with custom text and colors
- βΏ Accessibility Features - Semantic labels, tooltips, and screen reader support
- π Flexible Styling - Support for gradients, shadows, borders, and custom colors
- π Responsive Design - Adapts to different screen sizes
- π Gradient Support - Optional gradient backgrounds
Installation π¦ #
Add this to your package's pubspec.yaml file:
dependencies:
liquid_glass_nav: ^1.0.0
Then run:
flutter pub get
Quick Start π #
import 'package:flutter/material.dart';
import 'package:liquid_glass_nav/liquid_glass_nav.dart';
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _currentIndex = 0;
final List<LiquidGlassNavItem> _items = [
LiquidGlassNavItem(
icon: Icons.home,
label: 'Home',
tooltip: 'Home Screen',
),
LiquidGlassNavItem(
icon: Icons.search,
label: 'Search',
tooltip: 'Search Screen',
),
LiquidGlassNavItem(
icon: Icons.favorite,
label: 'Favorites',
tooltip: 'Favorites Screen',
),
LiquidGlassNavItem(
icon: Icons.person,
label: 'Profile',
tooltip: 'Profile Screen',
),
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
// Your page content here
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.blue.shade300, Colors.purple.shade300],
),
),
),
// Navigation bar at the bottom
Positioned(
left: 16,
right: 16,
bottom: 20,
child: LiquidGlassBottomNav(
items: _items,
currentIndex: _currentIndex,
onTap: (index) {
setState(() {
_currentIndex = index;
});
},
),
),
],
),
);
}
}
Advanced Usage π¨ #
With Animation Types #
LiquidGlassBottomNav(
items: _items,
currentIndex: _currentIndex,
onTap: (index) => setState(() => _currentIndex = index),
animationType: NavAnimationType.rotateScale, // Try: scale, slideUp, rotateScale, fade
animationDuration: Duration(milliseconds: 300),
animationCurve: Curves.easeInOut,
)
With Badges #
final items = [
LiquidGlassNavItem(
icon: Icons.home,
label: 'Home',
),
LiquidGlassNavItem(
icon: Icons.message,
label: 'Messages',
showBadge: true,
badgeText: '5',
badgeColor: Colors.red,
badgeTextColor: Colors.white,
),
LiquidGlassNavItem(
icon: Icons.notifications,
label: 'Alerts',
showBadge: true, // Shows dot badge without text
),
];
With Haptic Feedback #
LiquidGlassBottomNav(
items: _items,
currentIndex: _currentIndex,
onTap: (index) => setState(() => _currentIndex = index),
enableHapticFeedback: true,
hapticFeedbackType: HapticFeedbackType.medium, // light, medium, heavy, selection
)
With Custom Styling #
LiquidGlassBottomNav(
items: _items,
currentIndex: _currentIndex,
onTap: (index) => setState(() => _currentIndex = index),
backgroundColor: Colors.white.withOpacity(0.2),
selectedItemColor: Colors.blue,
unselectedItemColor: Colors.grey,
blurIntensity: 15.0,
height: 70.0,
borderRadius: BorderRadius.circular(30),
gradient: LinearGradient(
colors: [
Colors.white.withOpacity(0.3),
Colors.white.withOpacity(0.1),
],
),
)
With Ripple Effect #
LiquidGlassBottomNav(
items: _items,
currentIndex: _currentIndex,
onTap: (index) => setState(() => _currentIndex = index),
enableRipple: true,
rippleColor: Colors.blue.withOpacity(0.3),
)
Complete Example π± #
Check out the example folder for complete working examples including:
- Basic navigation
- Badge examples
- Different animation types
- Gradient backgrounds
- Custom styling
- Haptic feedback
- Accessibility features
Best Practices π‘ #
- Position the nav bar: Use Stack widget to overlay the navigation bar at the bottom
- Background: Works best with colorful or gradient backgrounds for the glass effect
- Contrast: Ensure good contrast between selected/unselected items
- Item count: Recommended 3-5 items for optimal UX
- Accessibility: Always provide semanticLabel and tooltip for better accessibility
- Haptic feedback: Use appropriate haptic feedback type for your app's feel
- Badges: Use badges sparingly for important notifications
Platform Support π― #
| Platform | Support |
|---|---|
| Android | β |
| iOS | β |
| 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 βοΈ #
Created by Om Prakash Yadav
Support β #
If you like this package, please give it a β on GitHub!
Made with Flutter π