PhotoViewControllerBase<T extends PhotoViewControllerValue> class abstract

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.
no setterinherited
outputStateStream Stream<T>
The output for state/value updates. Usually a broadcast Stream
no setter
position Offset
The position of the image in the screen given its offset after pan gestures.
getter/setter pair
prevValue ↔ T
The state value before the last change or the initial state if the state has not been changed.
getter/setter pair
rotation double
The rotation factor to transform the child (image or a customChild).
getter/setter pair
rotationFocusPoint Offset?
The center of the rotation transformation. It is a coordinate referring to the absolute dimensions of the image.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double?
The scale factor to transform the child (image or a customChild).
getter/setter pair
value ↔ T
The actual state value
getter/setter pair

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 nonexistent 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
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