Native ios context menu (#143002)

It's now possible to use the native-rendered text selection context menu on iOS. This sacrifices customizability in exchange for avoiding showing a notification when the user presses "Paste". It's off by default, but to enable, see the example system_context_menu.0.dart.
This commit is contained in:
Justin McCandless
2024-05-13 08:48:56 -07:00
committed by GitHub
parent 708fe97f9e
commit 125543505d
13 changed files with 1327 additions and 49 deletions

View File

@@ -307,6 +307,18 @@ class TestPlatformDispatcher implements PlatformDispatcher {
_nativeSpellCheckServiceDefinedTestValue = null;
}
@override
bool get supportsShowingSystemContextMenu => _supportsShowingSystemContextMenu ?? _platformDispatcher.supportsShowingSystemContextMenu;
bool? _supportsShowingSystemContextMenu;
set supportsShowingSystemContextMenu(bool value) { // ignore: avoid_setters_without_getters
_supportsShowingSystemContextMenu = value;
}
/// Resets [supportsShowingSystemContextMenu] to the default value.
void resetSupportsShowingSystemContextMenu() {
_supportsShowingSystemContextMenu = null;
}
@override
bool get brieflyShowPassword => _brieflyShowPasswordTestValue ?? _platformDispatcher.brieflyShowPassword;
bool? _brieflyShowPasswordTestValue;
@@ -458,6 +470,7 @@ class TestPlatformDispatcher implements PlatformDispatcher {
clearTextScaleFactorTestValue();
clearNativeSpellCheckServiceDefined();
resetBrieflyShowPassword();
resetSupportsShowingSystemContextMenu();
resetInitialLifecycleState();
resetSystemFontFamily();
}