obtainKey method

Converts a pictureProvider's settings plus a pictureConfiguration to a key that describes the precise picture to load.

The type of the key is determined by the subclass. It is a value that unambiguously identifies the picture (including its scale) that the load method will fetch. Different PictureProviders given the same constructor arguments and PictureConfiguration objects should return keys that are '==' to each other (possibly by using a class for the key that itself implements ==).

Implementation

@override
Future<PictureKey<NetworkPictureKeyData>> obtainKey(
    PictureConfiguration picture) {
  return SynchronousFuture<PictureKey<NetworkPictureKeyData>>(
    PictureKey<NetworkPictureKeyData>(
      NetworkPictureKeyData(url: url, headers: headers),
      colorFilter: colorFilter,
      theme: theme,
    ),
  );
}