PickerFont class

A wrapper class that contains details about each font in the FontPicker.

Returned from the onFontChanged method of the FontPicker.

Use the toTextStyle method to style any Text with the particular font.

Constructors

PickerFont({required String fontFamily, FontWeight fontWeight = FontWeight.w400, FontStyle fontStyle = FontStyle.normal, bool isRecent = false})
PickerFont.fromFontSpec(String fontSpec)
Constructs a PickerFont from a font spec description (a shorthand string that can describe a font), e.g. "Roboto:700i".
factory

Properties

category String
getter/setter pair
fontFamily String
final
fontStyle FontStyle
final
fontWeight FontWeight
final
hashCode int
The hash code for this object.
no setterinherited
isRecent bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subsets List<String>
getter/setter pair
variants List<String>
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toFontSpec() String
Converts a PickerFont to a font spec description, a shorthand string that can describe a font. Examples of font specs: "Roboto:400", "Merriweather:700i", "Archivo Narrow:200i".
toString() String
A string representation of this object.
inherited
toTextStyle() TextStyle
Provides a TextStyle object that can be used to style any Text with the selected Google font.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

parseVariants(String fontFamily) List<String>