flutter_liquid_glass_plus 0.0.3
flutter_liquid_glass_plus: ^0.0.3 copied to clipboard
A beautiful Flutter package for creating stunning liquid glass morphism UI effects. Transform your Flutter apps with elegant, modern glassmorphism designs.
flutter_liquid_glass_plus #
A beautiful Flutter package for creating stunning liquid glass morphism UI effects. Transform your Flutter apps with elegant, modern glassmorphism designs that blur the line between UI and reality.
Features #
- Beautiful Glass Effects - Create stunning liquid glass morphism UI components
- High Performance - Optimized rendering with quality presets
- Flexible Components - Comprehensive set of glass widgets for all your needs
- Customizable - Fine-tune blur, thickness, and visual properties
- Cross-Platform - Works seamlessly on iOS, Android, Web, and Desktop
- Grouped or Standalone - Use shared glass layers or independent effects
Preview #
https://github.com/user-attachments/assets/e1a18346-d5be-4d86-8b94-80f0fc3d1517
https://github.com/user-attachments/assets/eb01e0cd-b043-499e-8f0c-cb033e384324
https://github.com/user-attachments/assets/10ce1d27-dffc-4604-8d0e-b22928a4c641
https://github.com/user-attachments/assets/80988221-7820-404f-9647-a1fd65b904ed
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
flutter_liquid_glass_plus: ^0.0.3
Then run:
flutter pub get
Available Widgets #
Buttons & Controls #
LGSwitch- iOS-style toggle switch with liquid glass effectLGSlider- Draggable slider with jelly physics and glass thumbLGButton- Glass morphism button with customizable stylesLGIconButton- Icon button with glass effectLGChip- Glass chip widgetLGButtonGroup- Grouped button containerLGPanel- Glass panel container
Surfaces #
LGAppBar- Glass navigation bar for app headersLGBottomBar- Bottom navigation bar with glass effect and search supportLGBottomBarTab- Tab configuration for bottom barLGBottomBarExtraButton- Extra button for bottom barLGTabBar- Horizontal tab bar with glass effectLGTab- Tab configuration for tab barLGSideBar- Side navigation barLGSideBarItem- Side bar item configurationLGToolBar- Toolbar with glass effect
Overlays #
LGSheet- Bottom sheet with glass effect and drag indicatorLGDialog- Modal dialog with glass morphismLGDialogAction- Dialog action buttonLGMenu- Context menu with glass effectLGMenuItem- Menu item configuration
Entry & Forms #
LGTextField- Text input field with glass effectLGTextArea- Multi-line text areaLGFormField- Form field wrapper with label and error textLGSearchBar- Search bar with glass stylingLGPicker- Picker widget with glass effectLGPasswordField- Password input field
Components #
LGCard- Glass card widget with iOS-style defaultsLGContainer- Flexible container with glass effectsLGIndicator- Glass indicator for selections
Quick Start #
Basic Usage #
Wrap your app with a LiquidGlassLayer to enable glass effects:
import 'package:flutter_liquid_glass_plus/flutter_liquid_glass.dart';
import 'package:liquid_glass_renderer/liquid_glass_renderer.dart';
LiquidGlassLayer(
settings: const LiquidGlassSettings(
thickness: 30,
blur: 30,
),
child: YourAppContent(),
)
Example Usage #
LGBottomBar #
Create beautiful bottom navigation bars with glass effect. Supports search functionality, tab navigation, and customizable glass settings.
Important: Don't forget to use extendBody: true when using LGBottomBar in your Scaffold.
Scaffold(
extendBody: true,
bottomNavigationBar: LGBottomBar(
tabs: [
LGBottomBarTab(label: 'Home', icon: Icon(Icons.home)),
LGBottomBarTab(label: 'Search', icon: Icon(Icons.search)),
LGBottomBarTab(label: 'Profile', icon: Icon(Icons.person)),
],
selectedIndex: index,
onTabSelected: (index) {
setState(() {
_selectedIndex = index;
});
},
isSearch: true,
glassSettings: const LiquidGlassSettings(
thickness: 40,
blur: 15,
),
),
)
Use Cases:
- Main app navigation
- Tab-based interfaces
- Apps with search functionality
- Multi-section applications
LGAppBar #
Use LGAppBar for navigation bars at the top of your screens. Perfect for app headers with title, leading actions, and trailing buttons.
Important: Don't forget to use appBar property when using LGAppBar in your Scaffold.
Scaffold(
appBar: LGAppBar(
title: Text('Home'),
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {},
),
actions: [
IconButton(
icon: Icon(Icons.search),
onPressed: () {},
),
],
useOwnLayer: true,
settings: const LiquidGlassSettings(
thickness: 40,
blur: 20,
),
),
)
Use Cases:
- App navigation headers
- Screen titles with action buttons
- Settings screens
- Profile pages
LGSwitch #
iOS-style toggle switch with liquid glass effect. Perfect for settings and preferences.
LGSwitch(
value: _isEnabled,
onChanged: (value) {
setState(() {
_isEnabled = value;
});
},
)
Use Cases:
- Settings toggles
- Feature enable/disable switches
- Preference panels
- Configuration screens
LGSheet #
Bottom sheet with glass effect, perfect for menus and action sheets.
LGSheet.show(
context: context,
builder: (context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
leading: Icon(Icons.home),
title: Text('Home'),
onTap: () => Navigator.pop(context),
),
// More items...
],
),
settings: const LiquidGlassSettings(
thickness: 40,
blur: 20,
),
)
Use Cases:
- Action menus
- Bottom sheets
- Selection dialogs
- Quick actions
Standalone Container with Custom Layer #
One of the most powerful features is the ability to create standalone containers with their own independent glass layer. This is perfect when you want a container to have unique glass effect settings that differ from the parent layer.
When to Use Standalone Containers #
Use useOwnLayer: true when you want:
- Different blur/thickness settings for specific containers
- Independent glass effects that don't inherit from parent
- Isolated visual styling for special UI elements
- Performance optimization for specific components
Example: Standalone Container #
LGContainer(
// Enable standalone mode - creates its own glass layer
useOwnLayer: true,
// Custom glass effect settings (only used when useOwnLayer is true)
settings: const LiquidGlassSettings(
thickness: 20, // Glass thickness
blur: 10, // Blur intensity
),
// Standard container properties
padding: const EdgeInsets.all(20),
margin: const EdgeInsets.only(bottom: 40),
// Your content
child: const Column(
children: [
Icon(Icons.layers, color: Colors.white, size: 32),
SizedBox(height: 8),
Text(
'Standalone Container',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
],
),
)
How It Works #
-
useOwnLayer: true- Tells the container to create its own independentLiquidGlasslayer instead of using the grouped glass effect from the parentLiquidGlassLayer. -
settings- WhenuseOwnLayeris true, these settings control the glass effect for this specific container:thickness- Controls the visual thickness of the glass (higher = more opaque)blur- Controls the blur intensity of the background (higher = more blurred)
-
Independent Rendering - The container renders its glass effect independently, allowing you to have different visual styles within the same app while maintaining optimal performance.
Comparison: Grouped vs Standalone #
Grouped (default):
// Uses parent LiquidGlassLayer settings
LGContainer(
child: Text('Uses parent glass layer'),
)
Standalone:
// Creates its own layer with custom settings
LGContainer(
useOwnLayer: true,
settings: const LiquidGlassSettings(thickness: 20, blur: 10),
child: Text('Has its own glass layer'),
)
Customization #
Quality Presets #
Choose between performance and visual quality:
// Standard quality - optimized for performance
LGCard(
quality: LGQuality.standard,
child: YourContent(),
)
// Premium quality - maximum visual fidelity
LGCard(
quality: LGQuality.premium,
child: YourContent(),
)
Custom Shapes #
Customize the shape of your glass components:
LGCard(
shape: LiquidRoundedRectangle(borderRadius: 8),
child: YourContent(),
)
Use Cases #
- Modern Dashboards - Create elegant data visualization interfaces
- Settings Screens - Beautiful, organized settings panels
- Profile Cards - Eye-catching user profile displays
- Modal Dialogs - Premium-feeling dialog boxes
- Navigation Panels - Sleek sidebar navigation
- Onboarding Screens - Engaging first-impression experiences
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
License #
This project is licensed under the terms specified in the LICENSE file.
Acknowledgments #
Built with liquid_glass_renderer for the core rendering engine.