svgFromFile function
Instantiates a widget rendering an SVG picture from a File.
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 svgFromFile(
File file, {
Key? key,
Alignment alignment = Alignment.center,
bool excludeFromSemantics = false,
BoxFit fit = BoxFit.cover,
double? width,
double? height,
WidgetBuilder? placeholderBuilder,
String? semanticsLabel,
}) => SvgPicture.file(
file,
alignment: Alignment.center,
excludeFromSemantics: excludeFromSemantics,
fit: fit,
height: height,
key: key,
semanticsLabel: semanticsLabel,
width: width,
);