Open a choice menu over its anchor when the anchor is a whole pane

The add-pane picker is opened from a pane, not a button; with no room
above or below the anchor the panel was laid out with no height (found by
run 303's UI review).
This commit is contained in:
2026-11-10 22:41:59 +00:00
parent ba1cbccdf2
commit 6b82f51331
2 changed files with 77 additions and 18 deletions
+36
View File
@@ -102,6 +102,42 @@ void main() {
expect(menu.top, greaterThanOrEqualTo(8));
});
testWidgets('wide: anchored to a whole pane, the menu opens over its top', (
tester,
) async {
_size(tester, const Size(1280, 800));
await tester.pumpWidget(
MaterialApp(
home: Padding(
padding: const EdgeInsets.only(left: 400),
child: Builder(
builder: (pane) => Center(
child: TextButton(
onPressed: () => showAppChoiceMenu<void>(
pane,
width: 420,
builder: (_) => const SizedBox(
height: 300,
child: Center(child: Text('Picker')),
),
),
child: const Text('Open'),
),
),
),
),
),
);
await tester.tap(find.text('Open'));
await tester.pumpAndSettle();
final menu = tester.getRect(_menu);
expect(menu.size.width, 420);
expect(menu.height, greaterThanOrEqualTo(300));
expect(menu.left, 400);
expect(menu.top, lessThan(40));
expect(find.text('Picker').hitTestable(), findsOneWidget);
});
testWidgets('wide: details are a dialog', (tester) async {
_size(tester, const Size(1280, 800));
await tester.pumpWidget(_app());