Repository: flutter
Issue: [webview_flutter][android] `onPageFinished` is not working properly
Labels: platform-android,p: webview,customer: google,package,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-android,triaged-android

Internal: b/303031912

Hi,

I use the callback method 'onPageFinished' to control the visibility of a progress dialer, but the behavior is not working on android.

This callback method is called three times on Android device when start page loading and finish page loading, 

Version: - webview_flutter: ^3.0.0

I see it was raised here, and closed:
https://github.com/flutter/flutter/issues/35787

Here is my code:

<details>
<summary>code sample</summary>

```dart
class _MyHomePageState extends State<MyHomePage> {

  final Completer<WebViewController> _controller =
  Completer<WebViewController>();
  bool isLoading=true;

  @override
  void initState() {
    super.initState();
    if (Platform.isAndroid) {
      WebView.platform = SurfaceAndroidWebView();
    }
  }


  @override
  Widget build(BuildContext context) {

    return SafeArea(
      child: Scaffold(

        body: Stack(
          children: [

          Builder(builder: (BuildContext context) {
            return WebView(
              initialUrl: 'https://google.com/',
              javascriptMode: JavascriptMode.unrestricted,
              onWebViewCreated: (WebViewController webViewController) {
                _controller.complete(webViewController);
              },
              onProgress: (int progress) {
                print('WebView is loading (progress : $progress%)');

              },
              javascriptChannels: <JavascriptChannel>{
                _toasterJavascriptChannel(context),
              },
              navigationDelegate: (NavigationRequest request) {
                if (request.url.startsWith('https://www.youtube.com/')) {
                  print('blocking navigation to $request}');
                  return NavigationDecision.prevent;
                }
                print('allowing navigation to $request');
                return NavigationDecision.navigate;
              },
              onPageStarted: (String url) {
                print('Page started loading: $url');
              },
              onPageFinished: (String url) {
                print('Page finished loading: $url');
                setState(() {
                  isLoading = false;
                });
              },
              gestureNavigationEnabled: true,
              backgroundColor: const Color(0x00000000),
            );
          }),
            isLoading ? Center( child: CircularProgressIndicator(),)
                : Stack(),
          ]
        ),

      ),
    );
  }

  JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
    return JavascriptChannel(
        name: 'Toaster',
        onMessageReceived: (JavascriptMessage message) {
          // ignore: deprecated_member_use
          Scaffold.of(context).showSnackBar(
            SnackBar(content: Text(message.message)),
          );
        });
  }
} 
```
</details>