getSelectedText method

  1. @override
Future<String?> getSelectedText()

Gets the selected text.

NOTE: this method is implemented with using JavaScript.

NOTE for Android native WebView: available only on Android 19+.

NOTE for Web: this method will have effect only if the iframe has the same origin.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS
  • Web

Implementation

@override
Future<String?> getSelectedText() async {
  Map<String, dynamic> args = <String, dynamic>{};
  return await channel?.invokeMethod<String?>('getSelectedText', args);
}