dio_cache_ttl 0.3.3 copy "dio_cache_ttl: ^0.3.3" to clipboard
dio_cache_ttl: ^0.3.3 copied to clipboard

Flutter library for file caching with Time-to-Live (TTL) support.

example/main.dart

import 'dart:io';
import 'package:dio_cache_ttl/dio_cache_ttl.dart';

void main() async {
  const url =
      'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf';
  const cacheDuration = Duration(minutes: 5);

  try {
    File file = await dioCache(url, extFile: "pdf", ttl: cacheDuration);
    print('File downloaded and cached at: ${file.path}');
  } catch (e) {
    print('Error: $e');
  }
}
1
likes
160
points
33
downloads

Publisher

verified publisherflagodna.com

Weekly Downloads

Flutter library for file caching with Time-to-Live (TTL) support.

Repository (GitHub)
View/report issues

Topics

#cache #ttl #dio #file

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

dio, flutter, path_provider

More

Packages that depend on dio_cache_ttl