obtainKey method

  1. @override
Future<AssetBundleImageKey> obtainKey (ImageConfiguration configuration)
override

Converts an ImageProvider's settings plus an ImageConfiguration to a key that describes the precise image to load.

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

Implementation

@override
Future<AssetBundleImageKey> obtainKey(ImageConfiguration configuration) {
  return SynchronousFuture<AssetBundleImageKey>(AssetBundleImageKey(
    bundle: bundle ?? configuration.bundle ?? rootBundle,
    name: keyName,
    scale: scale
  ));
}