Surface class

๐ŸŒŸ Surface

A shapeable, layered, intrinsincally animated container Widget offering convenient access to blurring ImageFilters, Material InkResponse, and HapticFeedback.

Robustly customizable and, watch out, could also be expensive.


โ— CAUTION

With default ๐Ÿคนโ€โ™‚๏ธ SurfaceFX ๐Ÿ’ง Fx.blurry, only provide ๐Ÿ‘“ Filter.filteredLayers value for which you intend on passing each relevant ๐Ÿ’ง Filter.radiusMap map parameter.

  • Not only are the blurry BackdropFilters expensive, but the inheritance/ancestry behavior is strange.
  • If all three filters are active via ๐Ÿ‘“ Filter.filteredLayers, passing ๐Ÿ“Š baseRadius: 0 eliminates the remaining children filters, regardless of their passed ๐Ÿ“Š radius.
    • This behavior can be worked-around by setting any parent ๐Ÿ“š Layer's radius to just above 0, specifically radius > (_MINIMUM_BLUR == 0.0003)
    • ๐Ÿ“š BASE > ๐Ÿ“š MATERIAL > ๐Ÿ“š CHILD
    • But in this case a different ๐Ÿ‘“ FilterSpec.filteredLayers Set should be passed anyway that only activates the correct ๐Ÿ“š Layer(s).
Inheritance

Constructors

Surface({double? width, double? height, EdgeInsets margin = const EdgeInsets.all(0), EdgeInsets padding = const EdgeInsets.all(0), Color? color, Color? baseColor, Gradient? gradient, Gradient? baseGradient, Shape shape = const Shape(), Peek peek = Peek.DEFAULT, TapSpec tapSpec = const TapSpec(), Filter filter = Filter.DEFAULT, Duration duration = const Duration(milliseconds: 500), Curve curve = Curves.easeIn, Widget? child, Clip clipBehavior = Clip.hardEdge, Key? key})
๐ŸŒŸ Surface
const

Properties

baseColor โ†’ Color?
If ๐ŸŽจ color or ๐ŸŽจ baseColor is initialized, then initializing the respective Gradient parameter overrides the Color pass.
final
baseGradient โ†’ Gradient?
If ๐ŸŒ† gradient or ๐ŸŒ† baseGradient is initialized, then respective Color parameter is ignored.
final
child โ†’ Widget?
The ๐Ÿ‘ถ child Widget to render inside as the Surface content after considering all layout parameters.
final
clipBehavior โ†’ Clip
Defaults to standard Clip.hardEdge. Must not be Clip.none.
final
color โ†’ Color?
If ๐ŸŽจ color or ๐ŸŽจ baseColor is initialized, then initializing the respective Gradient parameter overrides the Color pass.
final
curve โ†’ Curve
The Curve that the internal AnimatedContainers use for intrinsic property-change animations.
final
duration โ†’ Duration
The Duration that the internal AnimatedContainers use for intrinsic property-change animations.
final
filter โ†’ Filter
Provided a ๐Ÿ”ฌ Filter to alter filter appearance at all ๐Ÿ“š SurfaceLayers.
final
gradient โ†’ Gradient?
If ๐ŸŒ† gradient or ๐ŸŒ† baseGradient is initialized, then respective Color parameter is ignored.
final
hashCode โ†’ int
The hash code for this object.
no setterinherited
height โ†’ double?
The width and height follow rules of AnimatedContainer, applying directly to the ๐Ÿ“š SurfaceLayer.BASE.
final
key โ†’ Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin โ†’ EdgeInsets
margin applies to ๐Ÿ“š SurfaceLayer.BASE and the ๐ŸŒŸ Surface as a whole.
final
padding โ†’ EdgeInsets
margin applies to ๐Ÿ“š SurfaceLayer.BASE and the ๐ŸŒŸ Surface as a whole.
final
peek โ†’ Peek
Surface ๐Ÿ”ฒ Peek.peek is applied as insets to ๐Ÿ“š SurfaceLayer.MATERIAL.
final
runtimeType โ†’ Type
A representation of the runtime type of the object.
no setterinherited
shape โ†’ Shape
WIP
final
tapSpec โ†’ TapSpec
Not only does ๐Ÿ‘† TapSpec.tappable provide onTap Callback, it also adds an InkResponse to the Material before rendering child.
final
width โ†’ double?
The width and height follow rules of AnimatedContainer, applying directly to the ๐Ÿ“š SurfaceLayer.BASE.
final

Methods

build(BuildContext context) โ†’ Widget
๐Ÿ‘ทโ€โ™‚๏ธ๐ŸŒŸ Build Surface
override
createElement() โ†’ StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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.
override
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}) โ†’ 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