getTheme static method

TextTheme getTheme(
  1. String fontFamily
)

Implementation

static TextTheme getTheme(String fontFamily) {
  TextTheme Function(TextTheme) textTheme;

  switch (fontFamily.toLowerCase()) {
    case 'roboto':
      textTheme = GoogleFonts.robotoTextTheme;
      break;
    case 'lato':
      textTheme = GoogleFonts.latoTextTheme;
      break;
    case 'montserrat':
      textTheme = GoogleFonts.montserratTextTheme;
      break;
    case 'opensans':
      textTheme = GoogleFonts.openSansTextTheme;
      break;
    case 'poppins':
      textTheme = GoogleFonts.poppinsTextTheme;
      break;
    case 'raleway':
      textTheme = GoogleFonts.ralewayTextTheme;
      break;
    case 'ubuntu':
      textTheme = GoogleFonts.ubuntuTextTheme;
      break;
    case 'playfairdisplay':
      textTheme = GoogleFonts.playfairDisplayTextTheme;
      break;
    case 'sourcesanspro':
      textTheme = GoogleFonts.sourceCodeProTextTheme;
      break;
    case 'oswald':
      textTheme = GoogleFonts.oswaldTextTheme;
      break;
    case 'merriweather':
      textTheme = GoogleFonts.merriweatherTextTheme;
      break;
    case 'nunito':
      textTheme = GoogleFonts.nunitoTextTheme;
      break;
    case 'quicksand':
      textTheme = GoogleFonts.quicksandTextTheme;
      break;
    case 'urbanist':
      textTheme = GoogleFonts.urbanistTextTheme;
      break;
    default:
      textTheme = GoogleFonts.robotoTextTheme;
  }

  return _applyResponsiveSizing(textTheme(ThemeData.light().textTheme));
}