David PHAM-VAN

Fix Image width and height attributes

1 # Changelog 1 # Changelog
2 2
  3 +## 1.6.1
  4 +
  5 +- Fix Image width and height attributes
  6 +
3 ## 1.6.0 7 ## 1.6.0
4 8
5 - Improve Annotations 9 - Improve Annotations
@@ -102,12 +102,14 @@ class Image extends Widget { @@ -102,12 +102,14 @@ class Image extends Widget {
102 @override 102 @override
103 void layout(Context context, BoxConstraints constraints, 103 void layout(Context context, BoxConstraints constraints,
104 {bool parentUsesSize = false}) { 104 {bool parentUsesSize = false}) {
105 - final double w = constraints.hasBoundedWidth  
106 - ? constraints.maxWidth  
107 - : constraints.constrainWidth(image.width.toDouble());  
108 - final double h = constraints.hasBoundedHeight  
109 - ? constraints.maxHeight  
110 - : constraints.constrainHeight(image.height.toDouble()); 105 + final double w = width ??
  106 + (constraints.hasBoundedWidth
  107 + ? constraints.maxWidth
  108 + : constraints.constrainWidth(image.width.toDouble()));
  109 + final double h = height ??
  110 + (constraints.hasBoundedHeight
  111 + ? constraints.maxHeight
  112 + : constraints.constrainHeight(image.height.toDouble()));
111 113
112 final FittedSizes sizes = applyBoxFit( 114 final FittedSizes sizes = applyBoxFit(
113 fit, 115 fit,
@@ -4,7 +4,7 @@ description: A pdf producer for Dart. It can create pdf files for both web or fl @@ -4,7 +4,7 @@ description: A pdf producer for Dart. It can create pdf files for both web or fl
4 homepage: https://github.com/DavBfr/dart_pdf/tree/master/pdf 4 homepage: https://github.com/DavBfr/dart_pdf/tree/master/pdf
5 repository: https://github.com/DavBfr/dart_pdf 5 repository: https://github.com/DavBfr/dart_pdf
6 issue_tracker: https://github.com/DavBfr/dart_pdf/issues 6 issue_tracker: https://github.com/DavBfr/dart_pdf/issues
7 -version: 1.6.0 7 +version: 1.6.1
8 8
9 environment: 9 environment:
10 sdk: ">=2.3.0 <3.0.0" 10 sdk: ">=2.3.0 <3.0.0"