ScaleValueCache class

Flyweight pattern cache for storing scaled values Reuses cached calculated values to minimize memory usage

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearCache() → void
Clear all caches (called on size/orientation change)
getBorderRadius({double? all, double? topLeft, double? topRight, double? bottomLeft, double? bottomRight}) BorderRadius
Get cached border radius or calculate and cache
getBorderRadiusFixed({double? all, double? topLeft, double? topRight, double? bottomLeft, double? bottomRight}) BorderRadius
Get cached border radius without scaling.
getBorderRadiusSafe({double? all, double? topLeft, double? topRight, double? bottomLeft, double? bottomRight}) BorderRadius
Get cached border radius using safe radius scaling.
getFixedRadius(double value) double
Get cached fixed radius (no scaling) or cache the raw value.
getFontSize(double value) double
Get cached font size or calculate and cache
getFontSizeClamp(double value, double min, double max) double
Get cached font size with clamp constraint or calculate and cache
getFontSizeMax(double value, double max) double
Get cached font size with max constraint or calculate and cache
getFontSizeMin(double value, double min) double
Get cached font size with min constraint or calculate and cache
getFontSizeWithFactor(double value) double
Get cached font size with factor or calculate and cache
getHeight(double value) double
Get cached height or calculate and cache
getHeightClamp(double value, double min, double max) double
Get cached height with clamp constraint or calculate and cache
getHeightMax(double value, double max) double
Get cached height with max constraint or calculate and cache
getHeightMin(double value, double min) double
Get cached height with min constraint or calculate and cache
getMargin({double? all, double? horizontal, double? vertical, double? top, double? bottom, double? left, double? right, double? start, double? end}) EdgeInsetsGeometry
Get cached margin or calculate and cache
getPadding({double? all, double? horizontal, double? vertical, double? top, double? bottom, double? left, double? right, double? start, double? end}) EdgeInsetsGeometry
Get cached padding or calculate and cache
getRadius(double value) double
Get cached radius or calculate and cache
getRadiusClamp(double value, double min, double max) double
Get cached radius with clamp constraint or calculate and cache
getRadiusMax(double value, double max) double
Get cached radius with max constraint or calculate and cache
getRadiusMin(double value, double min) double
Get cached radius with min constraint or calculate and cache
getRadiusSafe(double value) double
Get cached safe radius (scaled with gentle clamps) or calculate and cache
getScreenHeight(double value) double
Get cached screen height percentage or calculate and cache
getScreenHeightClamp(double value, double min, double max) double
Get cached screen height with clamp constraint or calculate and cache
getScreenHeightMax(double value, double max) double
Get cached screen height with max constraint or calculate and cache
getScreenHeightMin(double value, double min) double
Get cached screen height with min constraint or calculate and cache
getScreenWidth(double value) double
Get cached screen width percentage or calculate and cache
getScreenWidthClamp(double value, double min, double max) double
Get cached screen width with clamp constraint or calculate and cache
getScreenWidthMax(double value, double max) double
Get cached screen width with max constraint or calculate and cache
getScreenWidthMin(double value, double min) double
Get cached screen width with min constraint or calculate and cache
getTextStyle({required double fontSize, FontWeight? fontWeight, FontStyle? fontStyle, Color? color, String? fontFamily, double? letterSpacing, double? height, TextDecoration? decoration, Color? decorationColor, TextDecorationStyle? decorationStyle, double? decorationThickness}) TextStyle
Get cached TextStyle or calculate and cache
getWidth(double value) double
Get cached width or calculate and cache
getWidthClamp(double value, double min, double max) double
Get cached width with clamp constraint or calculate and cache
getWidthMax(double value, double max) double
Get cached width with max constraint or calculate and cache
getWidthMin(double value, double min) double
Get cached width with min constraint or calculate and cache
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance ScaleValueCache
no setter