File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -532,16 +532,23 @@ double? _width(Map<String, String> attributes) {
532
532
533
533
double _aspectRatio (
534
534
Map <String , String > attributes, AsyncSnapshot <Size > calculated) {
535
+ double aspectRatio;
535
536
final heightString = attributes["height" ];
536
537
final widthString = attributes["width" ];
537
538
if (heightString != null && widthString != null ) {
538
539
final height = double .tryParse (heightString);
539
540
final width = double .tryParse (widthString);
540
- return height == null || width == null
541
+ aspectRatio = height == null || width == null
541
542
? calculated.data! .aspectRatio
542
543
: width / height;
544
+ } else {
545
+ aspectRatio = calculated.data! .aspectRatio;
546
+ }
547
+ if (! aspectRatio.isNaN) {
548
+ return aspectRatio;
549
+ } else {
550
+ return 1 ;
543
551
}
544
- return calculated.data! .aspectRatio;
545
552
}
546
553
547
554
extension ClampedEdgeInsets on EdgeInsetsGeometry {
You can’t perform that action at this time.
0 commit comments