dispose method
Close the cache database.
Implementation
@override
Future<void> dispose() async {
final inFlightInit = _initCompleter;
if (inFlightInit != null) {
try {
await inFlightInit.future;
} on Object catch (_) {
// Ignore init errors during dispose.
}
}
if (_cacheBox != null && _cacheBox!.isOpen) {
await _cacheBox!.close();
}
await _hive.close();
_cacheBox = null;
_cacheDir = null;
_initCompleter = null;
}