AspectRatioValue constructor

AspectRatioValue(
  1. double width,
  2. double height
)

Create custom value of AspectRatioValue.

The applied width and height must be double.isFinite. Applying non-finite value will lead to throw ArgumentError.

Implementation

factory AspectRatioValue(double width, double height) {
  if (!width.isFinite || !height.isFinite) {
    throw ArgumentError("Width and height should be a finite number.");
  }

  return AspectRatioValue._(width, height);
}