ImageIcon constructor

const ImageIcon(
  1. ImageProvider<Object>? image, {
  2. Key? key,
  3. double? size,
  4. Color? color,
  5. String? semanticLabel,
  6. bool useOriginalColors = false,
})

Creates an image icon.

The size and color default to the value given by the current IconTheme.

Implementation

const ImageIcon(
  this.image, {
  super.key,
  this.size,
  this.color,
  this.semanticLabel,
  this.useOriginalColors = false,
}) : assert(
       !(useOriginalColors && color != null),
       'Cannot provide a color while useOriginalColors is true. '
       'To use a specific color, set useOriginalColors to false or omit it.',
     );