toCodeString method

  1. @override
String toCodeString()
override

Converts the position unit to a code string representation.

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

Implementation

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