[go: nahoru, domu]

Skip to content

Commit

Permalink
Fix: Update test case in menu anchor and menu style, rollback the spa…
Browse files Browse the repository at this point in the history
…ce change
  • Loading branch information
Vi-debug committed Jul 7, 2024
1 parent 5ac0182 commit 9881208
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/flutter/lib/src/material/menu_anchor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3386,6 +3386,7 @@ class _MenuPanelState extends State<_MenuPanel> {
final EdgeInsetsGeometry resolvedPadding = padding
.add(EdgeInsets.symmetric(horizontal: dx, vertical: dy))
.clamp(EdgeInsets.zero, EdgeInsetsGeometry.infinity);

BoxConstraints effectiveConstraints = visualDensity.effectiveConstraints(
BoxConstraints(
minWidth: minimumSize?.width ?? 0,
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter/test/material/menu_anchor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ void main() {
expect(tester.getRect(find.byType(MenuBar)), equals(const Rect.fromLTRB(105.0, 0.0, 695.0, 72.0)));
expect(
tester.getRect(find.widgetWithText(MenuItemButton, TestMenu.subMenu10.label)),
equals(const Rect.fromLTRB(249.0, 80.0, 483.0, 136.0)),
equals(const Rect.fromLTRB(257.0, 80.0, 491.0, 136.0)),
);
expect(
tester.getRect(
find.ancestor(of: find.text(TestMenu.subMenu10.label), matching: find.byType(Material)).at(1),
),
equals(const Rect.fromLTRB(241.0, 64.0, 491.0, 264.0)),
equals(const Rect.fromLTRB(249.0, 64.0, 499.0, 264.0)),
);
});

Expand Down Expand Up @@ -3181,7 +3181,7 @@ void main() {
equals(const <Rect>[
Rect.fromLTRB(161.0, 0.0, 639.0, 40.0),
Rect.fromLTRB(265.0, 40.0, 467.0, 160.0),
Rect.fromLTRB(467.0, 72.0, 707.0, 232.0),
Rect.fromLTRB(467.0, 80.0, 707.0, 240.0)
]),
);
});
Expand All @@ -3197,7 +3197,7 @@ void main() {
equals(const <Rect>[
Rect.fromLTRB(161.0, 0.0, 639.0, 40.0),
Rect.fromLTRB(333.0, 40.0, 535.0, 160.0),
Rect.fromLTRB(93.0, 72.0, 333.0, 232.0),
Rect.fromLTRB(93.0, 80.0, 333.0, 240.0),
]),
);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/test/material/menu_style_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ void main() {
expect(tester.getRect(find.byType(MenuBar)), equals(const Rect.fromLTRB(228.0, 0.0, 572.0, 48.0)));
expect(
tester.getRect(find.text(TestMenu.subMenu10.label)),
equals(const Rect.fromLTRB(366.0, 68.0, 559.0, 82.0)),
equals(const Rect.fromLTRB(372.0, 68.0, 565.0, 82.0)),
);
expect(
tester.getRect(find.ancestor(of: find.text(TestMenu.subMenu10.label), matching: find.byType(Material)).at(1)),
equals(const Rect.fromLTRB(346.0, 48.0, 579.0, 186.0)),
equals(const Rect.fromLTRB(352.0, 48.0, 585.0, 186.0)),
);
});
});
Expand Down

0 comments on commit 9881208

Please sign in to comment.