ViewportController class
Manages the viewer's zoom/pan state. The widget layer binds gestures (InteractiveViewer, scroll wheel, trackpad) to these setters.
- Inheritance
-
- Object
- ChangeNotifier
- ViewportController
Constructors
- ViewportController({double initialScale = 1.0, Offset initialOffset = Offset.zero, double minScale = 0.1, double maxScale = 5.0})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- maxScale → double
-
final
- minScale → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → ViewportState
-
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
fit(
Size contentSize, Size viewportSize) → void -
Fit
contentSizeinsideviewportSize(contain), centered. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pan(
Offset delta) → void -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void -
setOffset(
Offset offset) → void -
setScale(
double value) → void -
toString(
) → String -
A string representation of this object.
inherited
-
zoomAt(
Offset center, double factor) → void -
Zoom while keeping
center(in viewport-local coordinates) stable.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited