79389190

Date: 2025-01-26 19:46:28
Score: 1
Natty:
Report link

The flutter_html package(at least the version you've imported) under the hood uses the webview_flutter plugin. You didn't mention what version of flutter_html you are using, but, i suppose, it's around 2.2.1. This version works with webview_flutter package from version 2.0.4 till 3.0.0(exclusive).

The error you're getting says that the webview_flutter package doesn't provide the API we expect. That means only one thing: you are using a version of the webview_flutter that flutter_html(the version you're using) isn't ready to work with.

How is it possible? Perhaps, you're importing imperatively by yourself the webview_flutter in pubspec.yaml, and you're importing a version out of the range ">=2.0.4 <3.0.0"(perhaps you're importing a newer version, that changed its API).

How to solve the issue?

You have to make sure that both flutter_html package and your own code use the same version(API) of the webview_flutter plugin. You can do it either by:

  1. Downgrading the version of webview_flutter to the range that flutter_html expects
  2. Upgrading the flutter_html version(to the prerelease version. For example 3.0.0-beta2) because: it has been splitted into multiple packages, and now it is more modular, and it gives you the choice to import only the modules you need. webview_flutter is used in the iframe module. You may not need it at all, and, therefore, you will just not import it, and the problem is solved. And even if you need it, and you want to import it, this module uses already the newer API of the webview_flutter plugin(>=4.0.0 <5.0.0, i suppose, the one you are using), and it should solve your problem.

Hope it helps. Good luck!

Reasons:
  • Blacklisted phrase (1): How to solve
  • Whitelisted phrase (-1): Hope it helps
  • RegEx Blacklisted phrase (1.5): How to solve the issue?
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Radomir Epur