mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make EdgeDims and BoxConstraints printable (for debugging)
R=jackson@google.com Review URL: https://codereview.chromium.org/1166523006
This commit is contained in:
parent
8d52fb51dc
commit
0e06bfbee0
@ -36,6 +36,16 @@ class EdgeDims {
|
||||
(right == other.right) ||
|
||||
(bottom == other.bottom) ||
|
||||
(left == other.left);
|
||||
|
||||
int get hashCode {
|
||||
value = 373;
|
||||
value = 37 * value + top.hashCode;
|
||||
value = 37 * value + left.hashCode;
|
||||
value = 37 * value + bottom.hashCode;
|
||||
value = 37 * value + right.hashCode;
|
||||
return value;
|
||||
}
|
||||
String toString() => "EdgeDims($top, $right, $bottom, $left)";
|
||||
}
|
||||
|
||||
class BoxConstraints {
|
||||
@ -87,6 +97,16 @@ class BoxConstraints {
|
||||
}
|
||||
|
||||
bool get isInfinite => maxWidth >= double.INFINITY || maxHeight >= double.INFINITY;
|
||||
|
||||
int get hashCode {
|
||||
value = 373;
|
||||
value = 37 * value + minWidth.hashCode;
|
||||
value = 37 * value + maxWidth.hashCode;
|
||||
value = 37 * value + minHeight.hashCode;
|
||||
value = 37 * value + maxHeight.hashCode;
|
||||
return value;
|
||||
}
|
||||
String toString() => "BoxConstraints($minWidth<=w<$maxWidth, $minHeight<=h<$maxHeight)";
|
||||
}
|
||||
|
||||
class BoxParentData extends ParentData {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user