scale method
Returns a deeply-scaled copy of this theme.
Delegates to each child theme's scale and multiplies top-level
scalars (rowHeight, rowSpacing).
Deliberately omitted from delegation (per ADR-0001): scrollbarTheme is preserved as-is — scrollbars are chrome, not content. animationDuration is preserved as-is — time is not a length.
defaultFontSize is used to resolve null TextStyle.fontSize values
before scaling. Widget callers should prefer scaledForContext which
extracts this from the ambient Theme.
Identity: scale(factor: 1.0, defaultFontSize: …) returns this.
Implementation
FlutterFolderViewTheme<T> scale({
required double factor,
required double defaultFontSize,
}) {
assert(factor > 0, 'scale factor must be > 0, got $factor');
if (factor == 1.0) return this;
return copyWith(
rowHeight: rowHeight * factor,
rowSpacing: rowSpacing * factor,
lineTheme: lineTheme.scale(factor),
// scrollbarTheme: deliberately NOT delegated (ADR-0001 — scrollbars
// are chrome, not content, and must remain physically-sized for input).
folderTheme: folderTheme.scale(factor, defaultFontSize: defaultFontSize),
parentTheme: parentTheme.scale(factor, defaultFontSize: defaultFontSize),
childTheme: childTheme.scale(factor, defaultFontSize: defaultFontSize),
expandIconTheme: expandIconTheme.scale(factor),
spacingTheme: spacingTheme.scale(factor),
nodeStyleTheme: nodeStyleTheme.scale(factor),
);
}