Use SystemContextMenu by default on iOS (#165354)

With this change, widgets based on EditableText will show the system
context menu by default on iOS. Anyone with a custom contextMenuBuilder
will not be affected and will have to opt-in to using SystemContextMenu.
Also, this does not affect SelectionArea, which can't receive paste.

Fixes https://github.com/flutter/flutter/issues/163067
This commit is contained in:
Justin McCandless
2025-03-24 09:53:04 -07:00
committed by GitHub
parent f236af4975
commit 8128f08603
13 changed files with 374 additions and 6 deletions

View File

@@ -83,6 +83,21 @@ void main() {
);
});
testWidgets('TestPlatformDispatcher can fake supportsShowingSystemContextMenu', (
WidgetTester tester,
) async {
verifyPropertyFaked<bool>(
tester: tester,
realValue: PlatformDispatcher.instance.supportsShowingSystemContextMenu,
fakeValue: !PlatformDispatcher.instance.supportsShowingSystemContextMenu,
propertyRetriever:
() => WidgetsBinding.instance.platformDispatcher.supportsShowingSystemContextMenu,
propertyFaker: (TestWidgetsFlutterBinding binding, bool fakeValue) {
binding.platformDispatcher.supportsShowingSystemContextMenu = fakeValue;
},
);
});
testWidgets('TestPlatformDispatcher can fake brieflyShowPassword', (WidgetTester tester) async {
verifyPropertyFaked<bool>(
tester: tester,