primitives library
Lower-level building blocks for people writing their own glass widgets.
Everything here is public API and semver-stable, but the opinionated
surface in package:fresnel/fresnel.dart is what most apps want. This
library exists so the escape hatch does not clutter autocomplete for the
95% case.
Classes
- FallbackGlassSurface
- Last-resort glass: a plain blur with a tint and a hairline rim.
- FresnelPlatform
- The contract every platform implementation of Fresnel satisfies.
- GlassShaderProgram
- Loads and caches the fragment program once per isolate.
- ShaderGlassSurface
- Glass rendered with a fragment shader over the backdrop.
Functions
-
sdfRadiusFor(
GlassShape shape, Size size, {double concentric = 16}) → double - The corner radius the shader should use for its SDF, given a resolved size.
-
shapeBorderFor(
GlassShape shape, {double concentricRadius = 16}) → OutlinedBorder - Maps a GlassShape onto the Flutter shape that matches what iOS draws.