surface library
๐ Surface Library
A shapeable, layered, intrinsincally animated container Widget
offering convenient access to blurring ImageFilters,
Material InkResponse, and HapticFeedback.
+ ๐ BouncyBall
A delightfully bouncy and position-mirroring reaction to user input on a piece of Material.
References
- ๐ Surface - A shapeable, layered, animated container widget
- ๐ฐ SurfaceShape from Shape
- Defined by ๐ CornerSpec
- ๐ฒ Peek - Parameter object to customize ๐
BASE"peek" - ๐ TapSpec - Parameter object to customize tap appearance & behavior
- ๐ฌ Filter - Parameter object to customize ๐คนโโ๏ธ filters/effects!
- ๐คนโโ๏ธ SurfaceFX
Function typedef
- ๐คนโโ๏ธ SurfaceFX
๐ SurfaceLayer container layering offers robust customization.
- Support for both
Colors andGradients in both ๐ SurfaceLayerBASEandMATERIALlayers. - Support for three different Filter.effects and their strengths.
๐ฐ Shape customized SurfaceShapes
-
๐ CornerSpec
Shapedescription- Use
cornersto customize all four corners in a Shape and their ๐radius. - Specify
baseCornersseparately if desired. constCornerSpecs with pre-set configurations available:
- Use
-
โ
BorderSideborders- Add a BorderSide decoration to the edges of this Shape.
- Specify
baseBorderseparately if desired.
-
๐
CornerBorderRadiusradius- Defers to any Shape.corners or Shape.baseCorners supplied ๐ CornerSpec.radius, if available.
-
๐
SurfaceLayerpadLayer- Specify a ๐ SurfaceLayer to receive Surface.padding value.
- Default is ๐
SurfaceLayer.CHILD
-
๐
Shapescaling- See
doublesshapeScaleChild,shapeScaleMaterial,shapeScaleBase
- See
A ๐ฒ Peek may be provided to alter the Surface "peek"
(MATERIAL inset or "border") with parameter ๐ฒ Peek.peek.
- Give special treatment, generally a thicker appearance, to selected side(s) by passing ๐ฒ Peek.alignment and tuning with ๐ฒ Peek.ratio.
- Note: for true BorderSides, see ๐ฐ Shape.border.
Specify a ๐ฌ Filter with options to render ๐คนโโ๏ธ SurfaceFX backdrop ImageFilters
- In configured ๐ Filter.filteredLayers
Set - Whose radii (๐คนโโ๏ธ
effectstrength) are mapped with ๐ Filter.radiusMap- A ๐ SurfaceLayer.BASE filter may be extended through the Surface.margin with Filter.extendBaseFilter
A ๐ TapSpec offers TapSpec.onTap VoidCallback,
InkResponse customization, and a HapticFeedback shortcut.
References, continued
๐ BouncyBall
A delightfully bouncy and position-mirroring reaction to user input on a piece of Material.
Turn ink splashes for an InkWell, InkResponse or material Theme
into ๐ BouncyBalls or ๐ฎ Glass BouncyBalls
with the built-in InteractiveInkFeatureFactorys,
or design your own with ๐ช BouncyBall.mold.
๐ Extra Goodies
- ๐ฆ Shading
Colorextension- โฌ
withBlack.withBlack(int subtract) - โฌ
withWhite.withWhite(int add)
- โฌ
- ๐ค DragNub A small, round "handle" indicator used to visualize impression of draggable material
โ Consideration
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: 0eliminates the remaining children filters, regardless of their passed ๐radius.- This behavior can be worked-around by setting any parent ๐
Layer'sradiusto just above0, specificallyradius > (_MINIMUM_BLUR == 0.0003) ๐ BASE > ๐ MATERIAL > ๐ CHILD- But in this case a different ๐
FilterSpec.filteredLayersSetshould be passed anyway that only activates the correct ๐Layer(s).
- This behavior can be worked-around by setting any parent ๐
Classes
- BouncyBall
-
๐
BouncyBall - CornerSpec
- ๐ CornerSpec
- DragNub
- Filter
- ๐ฌ Filter
- FX
- ๐คนโโ๏ธ Surface FX
- Peek
- ๐ฒ Peek
- Shape
- ๐ฐ Shape
- Surface
- ๐ Surface
- SurfaceShape
- Responsible for accepting a CornerSpec, BorderRadiusGeometry, and optionally a BorderSide description, and generating an OutlinedBorder that may be pathed.
- TapSpec
- ๐ TapSpec
Enums
- Corner
- ๐ Corner
- SurfaceLayer
- ๐ SurfaceLayer
Typedefs
- SurfaceFX = ImageFilter Function(double specRadius, SurfaceLayer layerForRender)
- ๐คนโโ๏ธ Surface FX