toString method

  1. @override
String toString()
override

Returns a string representation of this object.

Implementation

@override
String toString() {
  final msg = name != null ? ' (name: $name)' : '';
  final pos = '(${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})';
  final size = '(${width.toStringAsFixed(2)} x ${height.toStringAsFixed(2)})';
  final rotationStr =
      rotation == 0 ? '' : ', rotation: ${rotation.toStringAsFixed(2)}';
  final scaleXStr =
      scaleX == 1 ? '' : ', scaleX: ${scaleX.toStringAsFixed(2)}';
  final scaleYStr =
      scaleY == 1 ? '' : ', scaleY: ${scaleY.toStringAsFixed(2)}';
  return '$runtimeType$msg at $pos, size: $size$rotationStr$scaleXStr$scaleYStr';
}