layoutScaleFactor property

double get layoutScaleFactor

The scale factor to use for a fit of type Fit.layout.

When using Fit.layout, the artboard dimensions are scaled by this factor to determine the final size. A scale factor of 1.0 means the artboard dimensions will exactly match the widget size. Values less than 1.0 will make the artboard larger than the widget, while values greater than 1.0 will make it smaller.

For example, with a scale factor of 0.5:

  • Widget size: 200x100
  • Artboard size: 400x200

This is useful for controlling the scale of the artboard content relative to the widget size.

Implementation

double get layoutScaleFactor => _layoutScaleFactor;
set layoutScaleFactor (double value)

Implementation

set layoutScaleFactor(double value) {
  if (_layoutScaleFactor == value) return;
  _layoutScaleFactor = value;

  if (fit == Fit.layout) {
    _resizeArtboard();
  }

  notifyListeners();
}