scale method

FolderNodeTheme<T> scale(
  1. double factor, {
  2. required double defaultFontSize,
})

Returns a scaled copy with all spatial fields and text size multiplied by factor.

Scales: width, height, padding, margin, textStyle (font size + letter spacing). Does NOT scale: tooltipTheme. Tooltips are classified as chrome and excluded from Scale — see ADR-0004.

defaultFontSize is used to resolve a null TextStyle.fontSize before scaling — callers should pass Theme.of(context).textTheme.bodyMedium?.fontSize.

Identity: scale(1.0, defaultFontSize: …) returns this.

Implementation

FolderNodeTheme<T> scale(
  double factor, {
  required double defaultFontSize,
}) {
  assert(factor > 0, 'scale factor must be > 0, got $factor');
  if (factor == 1.0) return this;
  return copyWith(
    width: width * factor,
    height: height * factor,
    padding: padding * factor,
    margin: margin * factor,
    textStyle: scaleTextStyle(textStyle, factor, defaultFontSize),
    // tooltipTheme intentionally not delegated — ADR-0004 (chrome).
  );
}