Closed busslina closed 6 months ago
Hi, what a bummer... Sorry, this took me some time to research and understand your use-case and investigate possible solutions.
It seems that there are only two viable options for Dart Web projects:
build.yaml
to change the web_compiler strategy to fine
, as described here (I have successfully tested this myself, however I am not sure whether this configuration has any other side effects, so use with care!)I also tried modifying the stub to circumvent the pointless warning, but without using dynamic
as type it seems to be impossible to satisfy the web compiler (using dynamic
would also render the stub effectively impractical).
Interesting sidenote: The reason why this problem "only" exists in Dart and not in Flutter is because they made an (originally temporary) exception for Flutter Web. Source: https://github.com/dart-lang/build/issues/3614#issuecomment-1819457471
When transpiling for Dart Web I got this warning, which is fatal because it breaks the transpile:
I tried to bypass it by replacing this:
into this:
which leads to these static warnings (non-fatal), but the fatal warning still not solved:
Firstly I want to solve the fatal warning: Is there a way to import in a
web safe
way?Secondly, would be great that the first solution also removes the non fatal warnings.
Thanks