Scalar.xy constructor

const Scalar.xy(
  1. double x, [
  2. double? y
])

Positionally provide an x or Scalar.horizontal value then a y or Scalar.vertical value; returns a constructed Scalar object.

The y paramater is optional and will be filled with x if absent.

  • Scalar.xy(5) is equivalent to Scalar(horizontal: 5, vertical: 5) and still const.

Implementation

const Scalar.xy(double x, [double? y])
    // ignore: prefer_initializing_formals
    : horizontal = x,
      vertical = y ?? x;