ImageConfiguration createLocalImageConfiguration(BuildContext context, { Size size })

Creates an ImageConfiguration based on the given BuildContext (and optionally size).

This is the object that must be passed to BoxPainter.paint and to ImageProvider.resolve.

Source

ImageConfiguration createLocalImageConfiguration(BuildContext context, { Size size }) {
  return new ImageConfiguration(
    bundle: DefaultAssetBundle.of(context),
    devicePixelRatio: MediaQuery.of(context).devicePixelRatio,
    // TODO(ianh): provide the locale
    size: size,
    platform: Platform.operatingSystem
  );
}