FontPicker constructor

const FontPicker({
  1. Key? key,
  2. List<String> googleFonts = googleFontsList,
  3. bool showFontInfo = true,
  4. bool showFontVariants = true,
  5. bool showInDialog = false,
  6. int recentsCount = 3,
  7. required ValueChanged<PickerFont> onFontChanged,
  8. String? initialFontFamily,
  9. String lang = "en",
})

Creates a widget that lets the user select a Google font from a provided list.

The onFontChanged function retrieves the font that the user selects with an object containing details like the font's name, weight, style, etc.

You can then use its toTextStyle method to style any text with the selected font.

Implementation

const FontPicker({
  super.key,
  this.googleFonts = googleFontsList,
  this.showFontInfo = true,
  this.showFontVariants = true,
  this.showInDialog = false,
  this.recentsCount = 3,
  required this.onFontChanged,
  this.initialFontFamily,
  this.lang = "en",
});