fuseWithGFont function

TextStyle fuseWithGFont({
  1. required TextStyle starter,
  2. required String gFont,
})

Passes starter to the gFont's textStyle param Returns starter if gFont is not found/supported

Implementation

TextStyle fuseWithGFont({required TextStyle starter, required String gFont}) {
  switch (gFont) {
    case alexBrush:
      return GoogleFonts.alexBrush(textStyle: starter);
    case atkinsonHyperlegible:
      return GoogleFonts.atkinsonHyperlegible(textStyle: starter);
    case fingerPaint:
      return GoogleFonts.fingerPaint(textStyle: starter);
    case lexend:
      return GoogleFonts.lexend(textStyle: starter);
    case noto:
      return GoogleFonts.notoSans(textStyle: starter);
    case openSans:
      return GoogleFonts.openSans(textStyle: starter);
    case pressStart2P:
      return GoogleFonts.pressStart2p(textStyle: starter);
    case readexPro:
      return GoogleFonts.readexPro(textStyle: starter);
    case roboto:
      return GoogleFonts.roboto(textStyle: starter);
    case sourceCodePro:
      return GoogleFonts.sourceCodePro(textStyle: starter);
    default:
      return starter;
  }
}