SvgImage.icon constructor

SvgImage.icon(
  1. SvgData data, {
  2. Key? key,
  3. Alignment? alignment = Alignment.center,
  4. BoxFit? fit = BoxFit.contain,
  5. double? width,
  6. double? height,
  7. WidgetBuilder? placeholderBuilder,
  8. String? semanticsLabel,
  9. bool? excludeFromSemantics = false,
})

Instantiates a widget rendering an SVG picture from a SvgData.

Implementation

SvgImage.icon(
  SvgData data, {
  super.key,
  this.alignment = Alignment.center,
  this.fit = BoxFit.contain,
  double? width,
  double? height,
  this.placeholderBuilder,
  this.semanticsLabel,
  this.excludeFromSemantics = false,
}) : asset = data.asset,
     file = null,
     bytes = null,
     width = width ?? data.width,
     height = height ?? data.height;