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
'sradius
to just above0
, specificallyradius > (_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).
- This behavior can be worked-around by setting any parent ๐
- 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 theColor
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 theColor
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