getWidth function

double getWidth(
  1. int percent,
  2. dynamic context
)

Returns the width based on the specified percentage of the screen width.

Implementation

double getWidth(int percent, context) {
  return (MediaQuery.of(context).size.width * (percent / 100)).toDouble();
}