DynamicFontsFile class abstract
Describes a font file as it is expected to be received from the server.
If a file is retrieved and its hash does not match expectedFileHash, or it is not of expectedLength bytes length, the font will not be loaded, and the file will not be stored on the device.
Clients will need to subclass this to provide the correct URL. If the URL depends on the font variant, consider a pattern like this:
class MyFontFile extends DynamicFontsFile {
FiraGoFile(this.variant, String expectedFileHash, int expectedLength)
: super(expectedFileHash, expectedLength);
final DynamicFontsVariant variant;
@override
String get url =>
'https://example.com/MyFont-${variant.toApiFilenamePart()}.ttf';
}
Constructors
- DynamicFontsFile(String expectedFileHash, int expectedLength)
Properties
- expectedFileHash → String
-
finalinherited
- expectedLength → int
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → String
-
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited