getFileData method

Future<Uint8List> getFileData(
  1. String url
)

Implementation

Future<Uint8List> getFileData(String url) async {
  final cacheData = await _getCacheData(url);
  if (cacheData != null) {
    debugPrint("缓存过了$url");
    return cacheData;
  }

  final response = await get(Uri.parse(url));
  final file = File((await _getCachePath(url)));
  file.writeAsBytes(response.bodyBytes);
  return response.bodyBytes;
}