format method

String format([
  1. int x0 = 0,
  2. int? y0
])

Returns a formatted string representation of this vector.

x0 sets the default precision for all components; y0 overrides the precision for the Y component.

Example: [ <x>, <y> ]

Implementation

String format([int x0 = 0, int? y0]) =>
  '[ '
    '${x.toStringAsFixed(x0)}, '
    '${y.toStringAsFixed(y0 ?? x0)} '
  ']';