Problem when testing custom webview widget

Custom Code

I wrote custom webview widget to interact between webview javascript and other widgets. But I can't run the test.

// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/widgets/index.dart'; // Imports other custom widgets
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom widget code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';

class InteractiveWebView extends StatefulWidget {
  const InteractiveWebView({
    super.key,
    this.width,
    this.height,
    required this.threadId,
  });

  final double? width;
  final double? height;
  final String threadId;

  @override
  State<InteractiveWebView> createState() => _InteractiveWebViewState();
}

class _InteractiveWebViewState extends State<InteractiveWebView> {
  late final WebViewController _controller;

  @override
  void initState() {
    super.initState();

    final PlatformWebViewControllerCreationParams params =
        const PlatformWebViewControllerCreationParams();

    _controller = WebViewController.fromPlatformCreationParams(params)
      ..setJavaScriptMode(JavaScriptMode.unrestricted)
      ..addJavaScriptChannel(
        'JSChannel',
        onMessageReceived: (JavaScriptMessage message) {
          _showSnackbar(message.message);
        },
      )
      ..loadRequest(
        Uri.parse(
            'https://babble-a09e7.web.app/testwebview.html/${widget.threadId}'),
      );
  }

  void _showSnackbar(String text) {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(content: Text('Message from Web: $text')),
    );
  }

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: widget.width ?? double.infinity,
      height: widget.height ?? 500,
      child: WebViewWidget(controller: _controller),
    );
  }
}

I got this error >>
"A platform implementation for webview_flutter has not been set. Please ensure that an implementation of WebViewPlatform has been set to WebViewPlatform.instance before use. For unit testing, WebViewPlatform.instance can be set with your own test implementation."

What have you tried so far?

Searching the community and documentation, but can't find any clues.

I don't know if webview_flutter can run on the test mode or do I need to test it on android/ios emulator.

Did you check FlutterFlow's Documentation for this topic?
Yes
1