AssetImage constructor Null safety

const AssetImage(
  1. String assetName,
  2. {AssetBundle? bundle,
  3. String? package}

Creates an object that fetches an image from an asset bundle.

The assetName argument must not be null. It should name the main asset from the set of images to choose from. The package argument must be non-null when fetching an asset that is included in package. See the documentation for the AssetImage class itself for details.


const AssetImage(
  this.assetName, {
}) : assert(assetName != null);