toCodeString method

  1. @override
String toCodeString()
override

Converts the size unit to a code string representation.

Returns a string that represents this size unit in code form, useful for debugging and serialization.

Implementation

@override
String toCodeString() {
  if (min is SizeFixed &&
      (min as SizeFixed).value == 0 &&
      max is SizeFixed &&
      (max as SizeFixed).value == double.infinity) {
    return size.toCodeString();
  }
  return 'clamp(${size.toCodeString()}, min: ${min.toCodeString()}, max: ${max.toCodeString()})';
}