setSize method

  1. @override
void setSize(
  1. Size newSize
)
override

Sets the size of this annotation.

Override this method to implement resize behavior for your annotation. The default implementation does nothing.

For annotations with immutable size properties (like StickyAnnotation), this method should replace the annotation in the controller with a new instance having the updated size.

Example

@override
void setSize(Size newSize) {
  _width.value = newSize.width.clamp(minWidth, maxWidth);
  _height.value = newSize.height.clamp(minHeight, maxHeight);
}

Implementation

@override
void setSize(Size newSize) {
  runInAction(() {
    _width.value = newSize.width.clamp(minWidth, maxWidth);
    _height.value = newSize.height.clamp(minHeight, maxHeight);
  });
}