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

Caching system for Flutter using dio with TTL.

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
0
points
31
downloads

Publisher

verified publisherflagodna.com

Weekly Downloads

Caching system for Flutter using dio with TTL.

Repository (GitHub)
View/report issues

Topics

#cache #ttl #dio #file

Documentation

Documentation

License

unknown (license)

Dependencies

dio, flutter, path_provider

More

Packages that depend on dio_cache_ttl