LazyCanvasController class
Controller for LazyCanvas
- Mixed-in types
Constructors
- LazyCanvasController.new({bool debug = false, Offset? buildCacheExtent, Size hashCellSize = const Size(100, 100), Duration defaultAnimationDuration = const Duration(milliseconds: 300), CanvasBackground background = const DotGridBackground(), bool useIdsFromArgs = false, OnWidgetEnteredRender? onWidgetEnteredRender, OnWidgetExitedRender? onWidgetExitedRender, PointerSignalEventListener? rawPointerSignalListener, PointerDownEventListener? rawPointerDownListener, PointerMoveEventListener? rawPointerMoveListener, PointerUpEventListener? rawPointerUpListener, PointerCancelEventListener? rawPointerCancelListener})
Properties
- background ↔ CanvasBackground
-
getter/setter pair
- buildCacheExtent → Offset?
-
no setter
- buildExtent → Offset
-
no setter
- canvasSize → Size
-
no setter
- debug ↔ bool
-
getter/setter pair
- defaultAnimationDuration → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- offset → Offset
-
no setter
- onWidgetEnteredRender ↔ OnWidgetEnteredRender?
-
getter/setter pair
- onWidgetExitedRender ↔ OnWidgetExitedRender?
-
getter/setter pair
- rawPointerCancelListener ↔ PointerCancelEventListener?
-
getter/setter pair
- rawPointerDownListener ↔ PointerDownEventListener?
-
getter/setter pair
- rawPointerMoveListener ↔ PointerMoveEventListener?
-
getter/setter pair
- rawPointerSignalListener ↔ PointerSignalEventListener?
-
getter/setter pair
- rawPointerUpListener ↔ PointerUpEventListener?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double
-
no setter
- useIdsFromArgs → bool
-
final
Methods
-
addChild(
Offset position, Widget widget, {Size? childSize, CanvasChildId? id}) → CanvasChildId - Add a child at a given position with a widget. Returns the child ID. You need the child size for optimising the focus on child
-
addChildren(
List< CanvasChildArgs> children, {CanvasChildId? focusOnBuild}) → List<CanvasChildId> -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
animateToOffsetAndScale(
{required Offset offset, required double scale, Duration? duration, Curve curve = Curves.easeInOut}) → Future< void> - Animate the canvas to a new offset and scale
-
centerOnGridOffset(
Offset gsOffset, {Duration? duration, bool animate = true}) → void - Center the canvas so that the given grid-space offset is at the center of the viewport.
-
centerOnScreenOffset(
Offset ssOffset, {Duration? duration, bool animate = true}) → void - Center the canvas so that the given screen-space offset is at the center of the viewport.
-
clear(
) → void - Remove all children. Does not change where you are on the canvas.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
focusOnChild(
CanvasChildId id, {ScalingMode scalingMode = ScalingMode.keepScale, bool animate = true, double preferredHorizontalMargin = 16, Duration? duration, Size? childSize, dynamic forceRedraw = false}) → void - Focus the viewport on a child by its ID, with a margin in screen-space. If it's already rendered, size will be picked up from the child widget. If not an offstage rendering will be used ( double render ) Preferred horizontal margin used for ScalingMode.fitInViewport.
-
markDirty(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onCanvasSizeChange(
Size size) → void - Update the canvas size when the widget size changes.
-
onChildSizeChange(
CanvasChildId id, Size size) → void - Called when a child widget's size changes.
-
onScaleStart(
ScaleStartDetails details) → void - Called when a scale gesture starts.
-
onScaleUpdate(
ScaleUpdateDetails details) → void - Called when a scale gesture updates. Usually you would not want to override this
-
removeChild(
CanvasChildId id) → void - Remove a child by its ID.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setBuildCacheExtent(
Offset extent) → void - Applied on the next build
-
setBuildContext(
BuildContext context) → void -
setTickerProvider(
TickerProvider ticker) → void - Set the ticker provider for animations.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateChildWidget(
CanvasChildId id, Widget newWidget) → void - Update a child's widget.
-
updatePosition(
CanvasChildId id, Offset newPosition) → CanvasChildId - Update the position of a child by its ID.
-
updateScalebyDelta(
double delta, {Offset? focalPoint}) → void - Increment or decrement the scale by an additive delta value.
-
widgetsWithScreenPositions(
{bool forceRebuild = false}) → List< ChildInfo> - Currently rendered widgets with their position info
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited