putFile abstract method

Future<File> putFile(
  1. String url,
  2. Uint8List fileBytes, {
  3. String? key,
  4. String? eTag,
  5. Duration maxAge = const Duration(days: 30),
  6. String fileExtension = 'file',
})

Put a file in the cache. It is recommended to specify the eTag and the maxAge. When maxAge is passed and the eTag is not set the file will always be downloaded again. The fileExtension should be without a dot, for example "jpg". When cache info is available for the url that path is re-used. The returned File is saved on disk.

Implementation

Future<File> putFile(
  String url,
  Uint8List fileBytes, {
  String? key,
  String? eTag,
  Duration maxAge = const Duration(days: 30),
  String fileExtension = 'file',
});