When updating Flutter to the new version 3.22.0, I encountered a warning:
"The use of ‘FlutterLoader.loadEntrypoint’ is deprecated. Please use ‘FlutterLoader.load’ instead."
After making the change from ‘loadEntrypoint’ to ‘load’, I encountered another issue:
"FlutterLoader.load requires _flutter.buildConfig to be set"
Upon reviewing flutter.js, I realized that the ‘load’ function has more parameters than ‘loadEntrypoint’
I would like to ask if anyone knows the solution to this problem, please provide suggestions.
2
Answers
I’ve encountered this issue just today, spent a bit of time looking at the documentation and release notes and this is what i found:
https://docs.flutter.dev/platform-integration/web/bootstrapping
They have improved web app initialization:
index.html
, your code should look like this:Hope it helps!
I think the best way to handle this issue is to upgrade an older flutter project as mentioned in the Flutter documentation.
What I did was remove the files from
/web
directory, then run the following command:flutter create . --platforms=web
Reference:
https://docs.flutter.dev/platform-integration/web/bootstrapping