flush method
Flushes cache contents to bricks.json
.
Implementation
Future<void> flush() async {
await _bricksJsonFile.create(recursive: true);
_cache = Map.fromEntries(
_cache.entries.toList()..sort((a, b) => a.key.compareTo(b.key)),
);
await _bricksJsonFile.writeAsString(encode);
}