traced_cache_manager 1.1.0 copy "traced_cache_manager: ^1.1.0" to clipboard
traced_cache_manager: ^1.1.0 copied to clipboard

CacheManager implementation that integrates with Firebase Performance Monitoring to automatically record traces for network requests.

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:traced_cache_manager/traced_cache_manager.dart';

// TODO: Make sure to setup Firebase Performance Monitoring.
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  /// Example usage #2 from the README.
  Future<File> fetchFile(String uri) async {
    return await TracedCacheManager().getSingleFile(uri);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Traced Cache Manager Example',
      home: Container(),
    );
  }
}

/// Example usage #3 from the README.
class MyCustomCacheManager extends BaseCacheManager {
  static const key = 'libMyCustomCachedImageData';

  MyCustomCacheManager() : super(key, fileService: TracedHttpFileService());

  @override
  Future<String> getFilePath() {
    throw UnimplementedError();
  }
}
4
likes
40
pub points
0%
popularity

Publisher

unverified uploader

CacheManager implementation that integrates with Firebase Performance Monitoring to automatically record traces for network requests.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

firebase_performance, flutter, flutter_cache_manager, http, path, path_provider

More

Packages that depend on traced_cache_manager