ProgressiveBlurWidget class

A widget that applies a progressive blur effect to its child.

Simplest way to use it is to use the default constructor and provide a LinearGradientBlur object. See the documentation of that class for more information.

Alternatively, you can apply the blur as a blur texture via the .custom() constructor. The blur texture can be thought of as a strength map for the blur (final_sigma = sigma * texture(x, y).r). You can supply your own blur texture to create custom blur effects.

The blur is applied in two passes: first horizontally and then vertically.

The blur shader should be precached before using this widget to avoid a pop-in effect. You can do this by calling ProgressiveBlurWidget.precache as early as possible in your app (e.g. in main()).

Inheritance

Constructors

ProgressiveBlurWidget({Key? key, required LinearGradientBlur? linearGradientBlur, required double sigma, required Widget child, int blurTextureDimensions = 128, Color tintColor = Colors.transparent})
const
ProgressiveBlurWidget.custom({Key? key, required Image? blurTexture, required double sigma, required Widget child, Color tintColor = Colors.transparent})
const

Properties

blurTexture Image?
The blur texture to be used as the blur strength map.
final
blurTextureDimensions int
Dimensions of the blur texture. If not provided, it will be set to 128.
final
child Widget
The widget to be blurred.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
linearGradientBlur LinearGradientBlur?
A simple constructor that allows to specify a linear gradient blur.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sigma double
The standard deviation of the Gaussian blur.
final
tintColor Color
Tint color to apply to the blurred area.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ProgressiveBlurWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

precache() Future<void>
Precaches the blur shader so that it can be used synchronously later. This should be called as early as possible in your app (e.g. in main()).