AspectRatioValue constructor
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);
}