memorySvg function

Widget memorySvg(
  1. Uint8List bytes, {
  2. double? width,
  3. double? height,
  4. required BoxFit fit,
  5. required WidgetBuilder error,
})

An SVG image from bytes — a data: URL's, or a download's.

Implementation

Widget memorySvg(
  Uint8List bytes, {
  double? width,
  double? height,
  required BoxFit fit,
  required WidgetBuilder error,
}) => !looksLikeSvg(bytes)
    ? Builder(builder: error)
    : SvgPicture.memory(
        normalizeSvgText(bytes),
        width: width,
        height: height,
        fit: fit,
        errorBuilder: (context, _, _) => error(context),
      );