File tree Expand file tree Collapse file tree 3 files changed +719
-597
lines changed Expand file tree Collapse file tree 3 files changed +719
-597
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,19 @@ enum TooltipPosition {
69
69
70
70
bool get isHorizontal => isRight || isLeft;
71
71
bool get isVertical => isTop || isBottom;
72
+
73
+ TooltipPosition get opposite {
74
+ switch (this ) {
75
+ case TooltipPosition .left:
76
+ return TooltipPosition .right;
77
+ case TooltipPosition .right:
78
+ return TooltipPosition .left;
79
+ case TooltipPosition .top:
80
+ return TooltipPosition .bottom;
81
+ case TooltipPosition .bottom:
82
+ return TooltipPosition .top;
83
+ }
84
+ }
72
85
}
73
86
74
87
enum TooltipActionPosition {
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ class RenderObjectManager {
19
19
20
20
static Map <TooltipLayoutSlot , RenderObjectManager > renderObjects = {};
21
21
22
+ /// Clears renderObjects map
23
+ static void clear () => renderObjects.clear ();
24
+
22
25
/// Performs dry layout to calculate the preferred size without actually laying out
23
26
Size performDryLayout (BoxConstraints constraints) {
24
27
renderConstraints = constraints;
@@ -29,13 +32,19 @@ class RenderObjectManager {
29
32
/// Performs actual layout on the RenderBox
30
33
void performLayout (BoxConstraints constraints, {bool parentUsesSize = true }) {
31
34
customRenderBox.layout (constraints, parentUsesSize: parentUsesSize);
35
+ dryLayoutSize = customRenderBox.size;
32
36
}
33
37
34
38
/// Gets the current size of the RenderBox
35
39
Size get size => dryLayoutSize ?? customRenderBox.size;
36
40
37
41
Offset get getOffset => Offset (xOffset ?? 0 , yOffset ?? 0 );
38
42
43
+ MultiChildLayoutParentData get layoutParentData {
44
+ assert (customRenderBox.parentData is MultiChildLayoutParentData );
45
+ return customRenderBox.parentData! as MultiChildLayoutParentData ;
46
+ }
47
+
39
48
/// Sets the position of the RenderBox
40
49
void setOffset (double x, double y) {
41
50
xOffset = x;
You can’t perform that action at this time.
0 commit comments