removeDriver method

  1. @override
void removeDriver(
  1. String name
)
override

Removes a driver from the registry. Throws CacheException if the driver is not registered or is the default driver.

Implementation

@override
void removeDriver(String name) {
  if (!_drivers.containsKey(name)) {
    throw CacheException('Cache driver "$name" not registered');
  }

  final driver = _drivers[name]!;
  if (driver == _defaultDriver) {
    throw CacheException('Cannot remove the default cache driver');
  }

  _drivers.remove(name);
}