Frosted Glass

A Flutter package that provides customizable frosted glass effect containers.

Features

  • Create beautiful frosted/blurred glass effects with customizable parameters
  • Adjust blur intensity, opacity, and overlay color
  • Customize container dimensions, border radius, padding, and margin
  • Simple API for easy integration

Installation

Add the package to your pubspec.yaml:

yaml

dependencies: frosted_glass: ^0.0.1

Then run:

flutter pub get

Usage

Import the package:

import 'package:frosted_glass/frosted_glass.dart';

Basic usage:

FrostedGlass( width: 300, height: 100, padding: EdgeInsets.all(16), child: Center(child: Text('Default Frosted Glass')), )

Customized usage:

dart

FrostedGlass( width: 300, height: 100, blur: 15.0, opacity: 0.15, borderRadius: BorderRadius.circular(20), padding: EdgeInsets.all(16), overlayColor: Colors.blue, child: Center( child: Text( 'Customized Frosted Glass', style: TextStyle(color: Colors.white), ), ), )

Parameters

Parameter Type Default Description
child Widget? null The widget to display on top of the frosted glass
blur double 10.0 The blur intensity for the frosted effect
opacity double 0.2 The opacity of the overlay color (0.0 to 1.0)
overlayColor Color Colors.white The color to overlay on top of the blur
borderRadius BorderRadius? null The border radius of the container
width double? null The width of the container
height double? null The height of the container
padding EdgeInsetsGeometry? null The padding inside the container
margin EdgeInsetsGeometry? null The margin around the container
clipContent bool true Whether to clip the child to the border radius

Example

See the /example directory for a complete sample application.

License

This package is licensed under the MIT License - see the LICENSE file for details.

Libraries

frosted_glass