GlassOptics class

The shape of the refraction: how far in it reaches, how hard it bends, and how it falls off.

Annotations

Constructors

GlassOptics({double thickness = 21, double strength = -58.2, double edgePower = 1.9, double shoulder = 0.6, double widen = 0, double zoom = 1})
const

Properties

edgePower → double
Falloff exponent. Not identified on its own — see thickness.
final
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shoulder → double
Exponent on the depth itself: bend = (1 - (u/t)^shoulder)^edgePower.
final
strength → double
Peak sample displacement at the rim, logical px.
final
thickness → double
How far in from the rim the refraction reaches, logical px.
final
widen → double
How far past its own box the glass shows, logical px on every side — the backdrop of the grown box drawn into the shape, which minifies it.
final
zoom → double
How much the glass magnifies what is under it, about its centre: the sample is drawn from rel / zoom. 1 for every finish; iOS's tab-bar drop is 1.17 over the bar it is lifted from, on an iPhone and an iPad alike — the label under it 1.22x its resting size against 1.045x for a label beside it, both of which grew with the bar (D218).
final

Methods

copyWith({double? thickness, double? strength, double? edgePower, double? shoulder, double? widen, double? zoom}) → GlassOptics
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reach(Size half) → double
How far past its box a sample can land, logical px, on a box with half-extents half — what the capture has to hold beyond it.
toString() → String
A string representation of this object.
inherited
walk(Size half) → Offset
The per-axis fraction of its distance from the centre a sample walks out by, on a box with half-extents half — widen and zoom in one, which is what the shader takes.

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

none → const GlassOptics
The optics with the refraction switched off, for the control that says the whole route is transparent when the optics are.