key property

  1. @override
String key
override

The key used to save the data in the cache. This key must be unique. If you have multiple repositories with the same key, the cache will be overwritten.

Implementation

@override
String get key {
  /// We combine the `tag` and the `endpoint` to create a unique key
  /// and we use the md5 hash to create a unique but "shorter" key.
  /// When the `tag` is null, we use only the `endpoint` as the key.

  if (tag == null) {
    return endpoint.toString();
  } else {
    return '$tag,$endpoint';
  }
}