FontAsset class final

One font file of a FontFamily (a pubspec fonts: entry's - asset:): its path relative to the site's folder, its weight (100–900) and style.

Annotations
  • @immutable

Constructors

FontAsset({required String asset, int weight = 400, FontStyle style = FontStyle.normal})
const

Properties

asset → String
The file, relative to the site's folder (fonts/Inter-Bold.ttf): TrueType or OpenType (.ttf, .otf), or WOFF (.woff).
final
hashCode → int
The hash code for this object.
no setteroverride
italic → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style → FontStyle
normal or italic.
final
weight → int
The weight this file draws (Flutter's FontWeight, 100–900).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json) → FontAsset?
Null for anything without an asset.

Constants

keys → const Set<String>