findString method

  1. @SupportedPlatforms(platforms: [IOSPlatform(available: '14.0', apiName: 'WKWebView.findString', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3656413-findstring'), MacOSPlatform(available: '11.0', apiName: 'WKWebView.findString', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3656413-findstring')])
Future<bool> findString({
  1. required String find,
  2. bool caseSensitive = false,
  3. bool backwards = false,
  4. bool wraps = true,
})

Searches the page for find without presenting the system find UI.

On iOS/macOS this uses WKWebView.findString. A match is selected and scrolled into view.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • find: all platforms
  • caseSensitive: all platforms
  • backwards: all platforms
  • wraps: all platforms

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

Implementation

@SupportedPlatforms(
  platforms: [
    IOSPlatform(
      available: '14.0',
      apiName: 'WKWebView.findString',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3656413-findstring',
    ),
    MacOSPlatform(
      available: '11.0',
      apiName: 'WKWebView.findString',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3656413-findstring',
    ),
  ],
)
Future<bool> findString({
  required String find,
  bool caseSensitive = false,
  bool backwards = false,
  bool wraps = true,
}) {
  throw UnimplementedError(
    'findString is not implemented on the current platform',
  );
}