glassmorph 0.0.2
glassmorph: ^0.0.2 copied to clipboard
A customizable, lightweight Flutter widget for applying glassmorphism UI effects using blur, transparency, and optional borders.
Glassmorph #
A lightweight and customizable Flutter widget for applying Glassmorphism effects to any container. Easily add blur, transparency, and optional borders to give your UI a modern, frosted-glass look.
โจ Features #
- Customizable blur intensity
- Background color with transparency
- Optional glass border
- Configurable padding and border radius
- Easy to integrate
๐ฆ Installation #
Add the following to your pubspec.yaml:
dependencies:
glassmorph: <latest_version>
Replace <latest_version> with the current version of your package.
๐ผ๏ธ Welcome to Glassmorph #
[Welcome to Glassmorph]
๐ง Usage #
import 'package:glassmorph/glassmorph.dart';
Glassmorph(
borderRadius: 20,
glassEffect: 10,
glassBGColor: Colors.white.withOpacity(0.2),
enableGlassBorder: true,
glassBorder: Colors.white.withOpacity(0.3),
padding: EdgeInsets.all(16),
child: Text(
'Hi Maninder Singh',
style: TextStyle(color: Colors.white),
),
)
๐ Parameters #
| Property | Type | Description | Default |
|---|---|---|---|
child |
Widget |
Required. Content inside the glass container | โ |
padding |
EdgeInsets? |
Inner padding | EdgeInsets.all(15) |
borderRadius |
double? |
Border radius for rounded corners | 25.0 |
glassEffect |
double? |
Blur intensity for the background | 15.0 |
glassBGColor |
Color? |
Background color with opacity | Colors.white.withOpacity(0.2) |
enableGlassBorder |
bool |
Toggle border around the glass container | false |
glassBorder |
Color? |
Color of the optional border | Colors.white.withOpacity(0.3) |
๐ฆ Internals #
The main implementation lives in:
glassmorph.dart: The public-facing widgetglassmorph_config.dart: Handles defaults and logic for rendering
๐งช Example #
To see a full working example, clone the repo and run the sample Flutter app in example/.
๐ License #
MIT License. See LICENSE for more information.