surface library Null safety

๐ŸŒŸ 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.


  • ๐ŸŒŸ Surface - A shapeable, layered, animated container widget
  • ๐Ÿ”ฐ SurfaceShape from Shape
  • ๐Ÿ”ฒ 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

๐Ÿ“š SurfaceLayer container layering offers robust customization.

  • Support for both Colors and Gradients in both ๐Ÿ“š SurfaceLayer BASE and MATERIAL layers.
  • Support for three different Filter.effects and their strengths.

๐Ÿ”ฐ Shape customized SurfaceShapes

A ๐Ÿ”ฒ Peek may be provided to alter the Surface "peek" (MATERIAL inset or "border") with parameter ๐Ÿ”ฒ Peek.peek.

Specify a ๐Ÿ”ฌ Filter with options to render ๐Ÿคนโ€โ™‚๏ธ SurfaceFX backdrop ImageFilters

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 Color extension
    • โฌ› 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: 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).


๐Ÿ“ BouncyBall [...]
๐Ÿ“ CornerSpec [...]
๐Ÿ”ฌ Filter [...]
๐Ÿคนโ€โ™‚๏ธ Surface FX [...]
๐Ÿ”ฒ Peek [...]
๐Ÿ”ฐ Shape [...]
๐ŸŒŸ Surface [...]
Responsible for accepting a CornerSpec, BorderRadiusGeometry, and optionally a BorderSide description, and generating an OutlinedBorder that may be pathed. [...]
๐Ÿ‘† TapSpec [...]




๐Ÿ“ Corner [...]
๐Ÿ“š SurfaceLayer [...]


SurfaceFX = ImageFilter Function(double specRadius, SurfaceLayer layerForRender)
๐Ÿคนโ€โ™‚๏ธ Surface FX [...]