Skip to main content

glass 2.2.0 copy "glass: ^2.2.0" to clipboard
glass: ^2.2.0 copied to clipboard

Allows conversion of any widget to a "glass" or "frosted glass" version of itself

Pub Version License

Glass #

Easily convert any Widget into a glass / frosted glass version of itself, following the glassmorphism / glassmorphic design trend.

Sample screenshot Sample screenshot 2

Installation #

1. Add it #

flutter pub add glass

Requires Flutter 3.27 or newer (Dart 3.6+). Older Flutter versions automatically resolve to glass 2.0.0.

2. Import it #

Now in your Flutter code, you can use:

import 'package:glass/glass.dart';

Usage #

Simply call .asGlass()

For example:

Container(
    child: someChild,
).asGlass()

Glass blurs what is behind the widget, so it only shows up when there is content underneath (for example inside a Stack or over a background image).

Parameters #

Parameter Default Description
enabled true Enable or disable all effects.
blurX / blurY 10.0 Blur amount along each axis.
tintColor Colors.white Tint of the glass. Use Colors.transparent for no tint.
frosted true Adds a noise texture for a frosted look.
clipBorderRadius BorderRadius.zero Rounded corners. Ignored if clipper is set.
clipBehavior Clip.antiAlias How the glass is clipped.
clipBehaviour null Deprecated misspelling of clipBehavior, removed in 3.0.0.
tileMode TileMode.clamp How the blur samples at the edges.
clipper null Custom CustomClipper<RRect>.

A full example can be found in the example directory.

About me #

Visit my LinkedIn at https://www.linkedin.com/in/zaca

136
likes
0
points
1.76k
downloads

Publisher

verified publisherzac.ac

Weekly Downloads

Allows conversion of any widget to a "glass" or "frosted glass" version of itself

Repository (GitHub)
View/report issues

Topics

#glassmorphism #blur #effects #ui #widget

License

unknown (license)

Dependencies

flutter

More

Packages that depend on glass