getCacheSize method

Future<int> getCacheSize()

Implementation

Future<int> getCacheSize() async {
  final directory = await _generateDirectory();
  final files = directory.listSync(recursive: true);
  List<int> sizes = [];
  for (var file in files) {
    final stat = await file.stat();
    sizes.add(stat.size);
  }
  return sizes.reduce((value, size) => value + size);
}