customText static method

TextStyle customText(
  1. BuildContext context, {
  2. Color? color,
  3. double? sizeFactor,
  4. String? family,
  5. FontWeight? weight,
})

The custom text style for the app. Uses the MediaQuery size factor to adjust the text size.

Implementation

static TextStyle customText(
  BuildContext context, {
  Color? color,
  double? sizeFactor, // MediaQuery size factor
  String? family,
  FontWeight? weight,
}) {
  return TextStyle(
    fontSize: MediaQuery.of(context).size.width * (sizeFactor ?? 0.035),
    fontWeight: weight ?? FontWeight.w400,
    color: color ?? Colors.black,
  );
}