GlassMagnifier class

A draggable glass lens that magnifies what's under it, as the magnifier on glisse.kelvinzhang.ca: its middle shows the backdrop enlarged, and its bezel bends the edge of that.

It fills its parent, which is the area it can be dragged over, and lays the lens in it. It magnifies a GlassBackdrop's background (or, on Impeller, the live backdrop); give the parent one.

Inheritance

Constructors

GlassMagnifier.new({Key? key, double size = 120, double magnification = 1.5, double borderRadius = double.infinity, Offset? position, ValueChanged<Offset>? onMoved, Widget? child, double aspectRatio = 1})
Creates a magnifier.
const

Properties

aspectRatio → double
The lens's width over its height.
final
borderRadius → double
The lens's corner radius; double.infinity for a circle or capsule.
final
child → Widget?
Laid over the lens, such as a crosshair.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
magnification → double
How much the lens enlarges what's under its middle.
final
onMoved → ValueChanged<Offset>?
Called as the lens is dragged, with where its top-left corner is now.
final
position → Offset?
Where the lens's top-left corner sits in the area. Leave it null for the magnifier to keep its own, starting in the middle.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → double
The lens's width; its height is size / aspectRatio.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<GlassMagnifier>
Creates the mutable state for this widget at a given location in the tree.
override
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.
inherited
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, int wrapWidth = 65}) → 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