LazyCanvasController constructor
LazyCanvasController({
- double? minScale,
- double? maxScale,
- bool debug = false,
- double buildExtentMultiplier = 2,
- Size hashCellSize = const Size(100, 100),
- Duration defaultAnimationDuration = const Duration(milliseconds: 300),
- bool inertiaEnabled = true,
- double inertiaFrictionCoefficient = 0.0000135,
- CanvasBackground background = const DotGridBackground(),
- bool useIdsFromArgs = false,
- OnWidgetEnteredRender? onWidgetEnteredRender,
- OnWidgetExitedRender? onWidgetExitedRender,
- PointerSignalEventListener? rawPointerSignalListener,
- PointerDownEventListener? rawPointerDownListener,
- PointerMoveEventListener? rawPointerMoveListener,
- PointerUpEventListener? rawPointerUpListener,
- PointerCancelEventListener? rawPointerCancelListener,
Supplied zoom limits must be finite, positive, and ordered. The initial scale of 1 is clamped to these limits.
Implementation
LazyCanvasController({
this.minScale,
this.maxScale,
this.debug = false,
this.buildExtentMultiplier = 2,
Size hashCellSize = const Size(100, 100),
this.defaultAnimationDuration = const Duration(milliseconds: 300),
this.inertiaEnabled = true,
this.inertiaFrictionCoefficient = 0.0000135,
CanvasBackground background = const DotGridBackground(),
this.useIdsFromArgs = false,
this.onWidgetEnteredRender,
this.onWidgetExitedRender,
this.rawPointerSignalListener,
this.rawPointerDownListener,
this.rawPointerMoveListener,
this.rawPointerUpListener,
this.rawPointerCancelListener,
}) : assert(buildExtentMultiplier >= 1),
assert(inertiaFrictionCoefficient > 0 && inertiaFrictionCoefficient < 1),
_background = background,
_spatialHash = SpatialHashing<CanvasChildId>(cellSize: hashCellSize) {
if (minScale != null && (!minScale!.isFinite || minScale! <= 0)) {
throw ArgumentError.value(
minScale,
'minScale',
'Must be finite and positive',
);
}
if (maxScale != null && (!maxScale!.isFinite || maxScale! <= 0)) {
throw ArgumentError.value(
maxScale,
'maxScale',
'Must be finite and positive',
);
}
if (minScale != null && maxScale != null && minScale! > maxScale!) {
throw ArgumentError.value(
maxScale,
'maxScale',
'Must be at least minScale',
);
}
_baseScale = _scale = _clampScale(1);
}