downloadFontBytes method
Downloads the bytes of a font from the server given a url
.
Implementation
Future<Uint8List?> downloadFontBytes({required String url}) async {
try {
final http.Response response = await http.get(Uri.parse(url));
if (response.statusCode != 200) return null;
return Uint8List.view(response.bodyBytes.buffer);
} catch (e, str) {
logger.error(
_label,
'Error downloading font bytes',
error: e,
stackTrace: str,
);
return null;
}
}