svgFromBytes function

Widget svgFromBytes(
  1. Uint8List bytes, {
  2. Key? key,
  3. Alignment alignment = Alignment.center,
  4. bool excludeFromSemantics = false,
  5. BoxFit fit = BoxFit.cover,
  6. double? width,
  7. double? height,
  8. WidgetBuilder? placeholderBuilder,
  9. String? semanticsLabel,
})

Instantiates a widget rendering an SVG picture from an Uint8List.

Either the width and height arguments should be specified, or the widget should be placed in a context setting layout constraints tightly. Otherwise, the image dimensions will change as the image is loaded, which will result in ugly layout changes.

Implementation

Widget svgFromBytes(
  Uint8List bytes, {
  Key? key,
  Alignment alignment = Alignment.center,
  bool excludeFromSemantics = false,
  BoxFit fit = BoxFit.cover,
  double? width,
  double? height,
  WidgetBuilder? placeholderBuilder,
  String? semanticsLabel,
}) => _BrowserSvg(
  key: key,
  loader: _BytesSvgLoader(bytes),
  alignment: alignment,
  excludeFromSemantics: excludeFromSemantics,
  fit: fit,
  height: height,
  placeholderBuilder: placeholderBuilder,
  semanticsLabel: semanticsLabel,
  width: width,
);