scaleTo method

double scaleTo(
  1. BoxConstraints constraints, {
  2. required double designWidth,
  3. bool useWidth = true,
})

Get value scaled to constraints

Implementation

double scaleTo(
  BoxConstraints constraints, {
  required double designWidth,
  bool useWidth = true,
}) {
  final reference = useWidth ? constraints.maxWidth : constraints.maxHeight;
  return this * reference / designWidth;
}