sp method

double sp(
  1. BuildContext context
)

Returns this% of screen width for font size.

Example:

5.sp(context); // 5% of screen width as font size

Implementation

double sp(BuildContext context) =>
    (this / 100) * MediaQuery.of(context).size.width;