BaseCroppableImageController class abstract
A base class for controllers that can be used with this package.
- Inheritance
-
- Object
- ChangeNotifier
- BaseCroppableImageController
- Implementers
Constructors
-
BaseCroppableImageController({required ImageProvider<
Object> imageProvider, required CroppableImageData data, CroppableImagePostProcessFn? postProcessFn, CropShapeFn cropShapeFn = aabbCropShapeFn, double minimumCropDimension = 8.0})
Properties
-
canResetNotifier
→ ValueNotifier<
bool> -
Whether the controller can be reset to its initial state, i.e. whether
the image has been transformed.
final
- cropShapeFn → CropShapeFn
-
A function that provides the crop path for a given size.
final
- data ↔ CroppableImageData
-
The current crop data.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
imageProvider
→ ImageProvider<
Object> -
The image provider that represents the image to be cropped.
final
- initialData ← CroppableImageData
-
Sets the
_initialData, i.e. the data that was passed to this controller when it was created.no getter -
isChangedNotifier
→ ValueNotifier<
bool> -
Whether the current data is different from the initial data.
final
- isTransforming → bool
-
no setter
-
isTransformingNotifier
→ ValueNotifier<
bool> -
Whether the controller is currently transforming.
final
- lastTransformationArgs ↔ dynamic
-
getter/setter pair
- minimumCropDimension → double
-
A minimum size that the crop rect can have. Any attemps to transform the
crop rect to a value smaller than this (in any dimension) will be snapped
to this value.
final
- postProcessFn → CroppableImagePostProcessFn?
-
A function that is called in crop as a post-processing function. Use it
to, for example, compress the image, or update the state in the preview
page.
final
- resetData ← CroppableImageData
-
Sets the value for
_resetData, i.e. the value that the controller will default to when the "Reset" button is pressed.no getter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transformationInitialData ↔ CroppableImageData?
-
The state at the start of a transformation.
getter/setter pair
- viewportScale → double
-
The scale of the viewport.
no setter
- viewportSize ↔ Size?
-
Size of the available viewport.
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
crop(
) → Future< CropImageResult> - Crops the image and returns the cropped image as a Uint8List.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
getMatrixForBaseTransformations(
BaseTransformations newBaseTransformations) → Matrix4 - Returns the transformation matrix that is needed to transform the crop rect from the current base transformations to the new base transformations.
-
getNormalizedRect(
CroppableImageData data) → Rect -
normalize(
) → void - Normalizes the crop rect to fit inside the transformed image quad.
-
normalizeCropSize(
Size size) → Size - Checks the provided size and snaps it to minimumCropDimension if it's smaller.
-
normalizeImpl(
) → Rect -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onBaseTransformation(
CroppableImageData newData) → void - Called when a base transformation is applied. Implementers can override this to update the data and notify listeners.
-
onTransformation(
dynamic args) → void - Called during a transformation.
-
onTransformationEnd(
) → void - Called when a transformation ends.
-
onTransformationStart(
) → void - Called when a transformation starts.
-
recomputeValueNotifiers(
) → void - Recomputes the value notifiers. This is called when the data changes.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void - Resets the controller to its initial state.
-
setViewportSizeInBuild(
Size? size) → void -
Sets the size of the available viewport in the
buildmethod. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited