loadAsFile method

Future<File> loadAsFile(
  1. String fileName
)

Loads a single fileName to the cache but returns it as a File.

Note: this is not available for web, as File doesn't make sense on the browser!

Implementation

Future<File> loadAsFile(String fileName) async {
  if (kIsWeb) {
    throw 'This method cannot be used on web!';
  }
  final uri = await load(fileName);
  return File(uri.toFilePath());
}