getSelectedText method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(note: 'This method is implemented using JavaScript.'), IOSPlatform(note: 'This method is implemented using JavaScript.'), LinuxPlatform(note: 'This method is implemented using JavaScript.'), MacOSPlatform(note: 'This method is implemented using JavaScript.'), WebPlatform(note: 'This method is implemented using JavaScript.')])
Future<String?> getSelectedText()

Gets the selected text.

Officially Supported Platforms/Implementations:

  • Android WebView:
    • This method is implemented using JavaScript.
  • iOS WKWebView:
    • This method is implemented using JavaScript.
  • Linux WPE WebKit:
    • This method is implemented using JavaScript.
  • macOS WKWebView:
    • This method is implemented using JavaScript.
  • Web <iframe> but requires same origin:
    • This method is implemented using JavaScript.

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(note: 'This method is implemented using JavaScript.'),
    IOSPlatform(note: 'This method is implemented using JavaScript.'),
    LinuxPlatform(note: 'This method is implemented using JavaScript.'),
    MacOSPlatform(note: 'This method is implemented using JavaScript.'),
    WebPlatform(note: 'This method is implemented using JavaScript.'),
  ],
)
Future<String?> getSelectedText() {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.getSelectedText.name} is not implemented on the current platform',
  );
}