OudsSmallListItemTrailingImage.provider constructor

const OudsSmallListItemTrailingImage.provider({
  1. required ImageProvider<Object>? provider,
  2. String? semanticsLabel,
  3. OudsListItemImageFormat format = OudsListItemImageFormat.square,
  4. bool rounded = false,
  5. Widget? placeholder,
})

Creates a compact trailing image configuration from any ImageProvider (NetworkImage, MemoryImage or a provider supplied by the app).

placeholder is shown while the image is loading and if loading fails; when null, the image background color shows through instead.

OudsSmallListItemTrailingImage.provider(
  provider: NetworkImage('https://example.com/photo.jpg'),
  semanticsLabel: 'Product photo',
  placeholder: Image.asset('assets/placeholder.jpg'),
)

Implementation

const OudsSmallListItemTrailingImage.provider({
  required this.provider,
  this.semanticsLabel,
  this.format = OudsListItemImageFormat.square,
  this.rounded = false,
  this.placeholder,
}) : asset = null;