File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# CHANGES
22
3+ ## 0.21.0-nullsafety.1
4+
5+ - Fix bug introduced when width and height are both null on the widget.
6+ - Use more efficient method for XML attribute parsing.
7+
38## 0.21.0-nullsafety.0
49
510- Fix sizing when both width and height are null. This is potentially breaking.
Original file line number Diff line number Diff line change @@ -766,26 +766,30 @@ class _SvgPictureState extends State<SvgPicture> {
766766 height = width / viewport.width * viewport.height;
767767 }
768768
769- child = FittedBox (
770- fit: widget.fit,
771- alignment: widget.alignment,
772- clipBehavior: widget.clipBehavior,
773- child: SizedBox .fromSize (
774- size: viewport.size,
775- child: RawPicture (
776- _picture,
777- matchTextDirection: widget.matchTextDirection,
778- allowDrawingOutsideViewBox: widget.allowDrawingOutsideViewBox,
769+ if (height == null && width == null ) {
770+ height = viewport.height;
771+ width = viewport.width;
772+ }
773+ assert (height != null );
774+ assert (width != null );
775+
776+ child = SizedBox (
777+ width: width,
778+ height: height,
779+ child: FittedBox (
780+ fit: widget.fit,
781+ alignment: widget.alignment,
782+ clipBehavior: widget.clipBehavior,
783+ child: SizedBox .fromSize (
784+ size: viewport.size,
785+ child: RawPicture (
786+ _picture,
787+ matchTextDirection: widget.matchTextDirection,
788+ allowDrawingOutsideViewBox: widget.allowDrawingOutsideViewBox,
789+ ),
779790 ),
780791 ),
781792 );
782- if (width != null && height != null ) {
783- child = SizedBox (
784- width: width,
785- height: height,
786- child: child,
787- );
788- }
789793
790794 if (widget.pictureProvider.colorFilter == null &&
791795 widget.colorFilter != null ) {
Original file line number Diff line number Diff line change 11name : flutter_svg
22description : An SVG rendering and widget library for Flutter, which allows painting and displaying Scalable Vector Graphics 1.1 files.
33homepage : https://github.com/dnfield/flutter_svg
4- version : 0.21.0-nullsafety.0
4+ version : 0.21.0-nullsafety.1
55
66dependencies :
77 flutter :
You can’t perform that action at this time.
0 commit comments