downloadFont method

Future<void> downloadFont(
  1. CustomFontEntity customFont
)

Implementation

Future<void> downloadFont(CustomFontEntity customFont) async {
  final res = await client.get(Uri.parse(customFont.publicUrl));
  final fontLoader = FontLoader(customFont.name)
    ..addFont(_loadByteData(res.bodyBytes));
  await fontLoader.load();
}