onFindResultReceived property

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.FindListener.onFindResultReceived', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView.FindListener#onFindResultReceived(int,%20int,%20boolean)'), IOSPlatform(note: 'If [InAppWebViewSettings.isFindInteractionEnabled] is `true`, this event will not be called.'), MacOSPlatform(), LinuxPlatform(apiName: 'WebKitFindController::counted-matches', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.FindController.counted-matches.html'), WindowsPlatform(apiName: 'ICoreWebView2Find.ActiveMatchIndexChanged/MatchCountChanged', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2find')])
void Function(PlatformFindInteractionController controller, int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)? onFindResultReceived
final

Event fired as find-on-page operations progress. The listener may be notified multiple times while the operation is underway, and the numberOfMatches value should not be considered final unless isDoneCounting is true.

activeMatchOrdinal represents the zero-based ordinal of the currently selected match.

numberOfMatches represents how many matches have been found.

isDoneCounting whether the find operation has actually completed.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • controller: all platforms
  • activeMatchOrdinal: all platforms
  • numberOfMatches: all platforms
  • isDoneCounting: all platforms

Use the PlatformFindInteractionControllerCreationParams.isPropertySupported method to check if this property is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebView.FindListener.onFindResultReceived',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebView.FindListener#onFindResultReceived(int,%20int,%20boolean)',
    ),
    IOSPlatform(
      note:
          'If [InAppWebViewSettings.isFindInteractionEnabled] is `true`, this event will not be called.',
    ),
    MacOSPlatform(),
    LinuxPlatform(
      apiName: 'WebKitFindController::counted-matches',
      apiUrl:
          'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.FindController.counted-matches.html',
    ),
    WindowsPlatform(
      apiName: 'ICoreWebView2Find.ActiveMatchIndexChanged/MatchCountChanged',
      apiUrl:
          'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2find',
    ),
  ],
)
final void Function(
  PlatformFindInteractionController controller,
  int activeMatchOrdinal,
  int numberOfMatches,
  bool isDoneCounting,
)?
onFindResultReceived;