David PHAM-VAN

Add equality operator to PdfPageFormat

@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 - Add TableOfContent Widget 6 - Add TableOfContent Widget
7 - Add LinearProgressIndicator 7 - Add LinearProgressIndicator
8 - Add PdfOutline.toString() 8 - Add PdfOutline.toString()
  9 +- Add equality operator to PdfPageFormat
9 10
10 ## 3.3.0 11 ## 3.3.0
11 12
@@ -112,6 +112,23 @@ class PdfPageFormat { @@ -112,6 +112,23 @@ class PdfPageFormat {
112 112
113 @override 113 @override
114 String toString() { 114 String toString() {
115 - return 'Page ${width}x$height margins:$marginLeft, $marginTop, $marginRight, $marginBottom'; 115 + return '$runtimeType ${width}x$height margins:$marginLeft, $marginTop, $marginRight, $marginBottom';
116 } 116 }
  117 +
  118 + @override
  119 + bool operator ==(Object other) {
  120 + if (other is! PdfPageFormat) {
  121 + return false;
  122 + }
  123 +
  124 + return other.width == width &&
  125 + other.height == height &&
  126 + other.marginLeft == marginLeft &&
  127 + other.marginTop == marginTop &&
  128 + other.marginRight == marginRight &&
  129 + other.marginBottom == marginBottom;
  130 + }
  131 +
  132 + @override
  133 + int get hashCode => toString().hashCode;
117 } 134 }