Showing
2 changed files
with
19 additions
and
1 deletions
@@ -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 | } |
-
Please register or login to post a comment