responsiveSize method

TextStyle responsiveSize(
  1. BuildContext context,
  2. double factor
)

Makes the font responsive based on screen width.

Implementation

TextStyle responsiveSize(BuildContext context, double factor) {
  double screenWidth = MediaQuery.of(context).size.width;
  return copyWith(fontSize: screenWidth * factor);
}