addImage method

void addImage(
  1. String src,
  2. String alt, {
  3. SummaryImageOptions? options,
})

Adds an HTML image tag to the summary buffer.

Implementation

void addImage(String src, String alt, {SummaryImageOptions? options}) {
  final width = options?.width;
  final height = options?.height;

  final attributes = {
    'src': src,
    'alt': alt,
    if (width != null) 'width': '$width',
    if (height != null) 'height': '$height',
  };

  addRaw(_wrap(tag: 'img', attributes: attributes), addEOL: true);
}