PhotoViewControllerBase<T extends PhotoViewControllerValue> class

The interface in which controllers will be implemented.

It concerns storing the state (PhotoViewControllerValue) and streaming its updates. PhotoViewImageWrapper will respond to user gestures setting thew fields in the instance of a controller.

Any instance of a controller must be disposed after unmount. So if you instantiate a PhotoViewController or your custom implementation, do not forget to dispose it when not using it anymore.

The controller exposes value fields like scale or rotationFocus. Usually those fields will be only getters and setters serving as hooks to the internal PhotoViewControllerValue.

The default implementation used by PhotoView is PhotoViewController.

This was created to allow customization (you can create your own controller class)

Previously it controlled scaleState as well, but duw to some concerns [ScaleStateListener is responsible for tat value now

As it is a controller, whoever instantiates it, should dispose it afterwards.

Implementers

Constructors

PhotoViewControllerBase()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
outputStateStream Stream<T>
The output for state/value updates. Usually a broadcast Stream
read-only
position Offset
The position of the image in the screen given its offset after pan gestures.
read / write
prevValue ↔ T
The state value before the last change or the initial state if the state has not been changed.
read / write
rotation double
The rotation factor to transform the child (image or a customChild).
read / write
rotationFocusPoint Offset
The center of the rotation transformation. It is a coordinate referring to the absolute dimensions of the image.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scale double
The scale factor to transform the child (image or a customChild).
read / write
value ↔ T
The actual state value
read / write

Methods

addIgnorableListener(VoidCallback callback) → void
Add a listener that will ignore updates made internally [...]
dispose() → void
Closes streams and removes eventual listeners.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeIgnorableListener(VoidCallback callback) → void
Remove a listener that will ignore updates made internally [...]
reset() → void
Resets the state to the initial value;
setScaleInvisibly(double scale) → void
Nevermind this method :D, look away
toString() String
Returns a string representation of this object.
inherited
updateMultiple({Offset position, double scale, double rotation, Offset rotationFocusPoint}) → void
Update multiple fields of the state with only one update streamed.

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited