custom_widgets/svg_image
library
Constants
-
maxInlineSvgLength
→ const int
-
Largest inline
<svg> drawn, in characters of markup. Past it the error
box shows instead, so one runaway reply cannot stall a frame parsing
megabytes of path data.
Functions
-
inlineSvg({required Map<String, String> attributes, required String markup, required bool closed, required WidgetBuilder error, Color? currentColor})
→ Widget
-
An inline
<svg> element — its attributes and the markup between its
tags — drawn as a picture.
-
isSvgUrl(String url)
→ bool
-
Whether
url names an SVG by itself: a path ending .svg, or a
data:image/svg+xml URL.
-
looksLikeSvg(Uint8List bytes)
→ bool
-
Whether
bytes start like an SVG document: an <svg element near the
start, after any XML declaration, doctype or comment.
-
memorySvg(Uint8List bytes, {double? width, double? height, required BoxFit fit, required WidgetBuilder error})
→ Widget
-
An SVG image from bytes — a
data: URL's, or a download's.
-
normalizeSvgText(Uint8List bytes)
→ Uint8List
-
bytes rewritten around two gaps in the SVG compiler under flutter_svg,
both of which every shields.io badge runs into. Anything else is left as
written, and rewritten bytes are kept, so a rebuild does not parse again.