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.
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: <body>
<script src="flutter_bootstrap.js" async></script>
</body>
<body>
<script>
window.addEventListener('load', function(ev) {
{{flutter_js}}
{{flutter_build_config}}
_flutter.loader.load({
serviceWorker: {
serviceWorkerVersion: {{flutter_service_worker_version}},
},
onEntrypointLoaded: function(engineInitializer) {
engineInitializer.initializeEngine().then(function(appRunner) {
if(document.getElementById('splash'))
document.getElementById('splash').remove();
appRunner.runApp();
});
}
});
});
</script>
<picture id="splash" >
<source srcset="splash/img/iso_gradient_vert-x3.png 1x" media="(prefers-color-scheme: light) or (prefers-color-scheme: no-preference)">
<source srcset="splash/img/iso_gradient_vert-x3.png 1x" media="(prefers-color-scheme: dark)">
<img class="center" src="splash/img/iso_gradient_vert-x3.png" width="500" height="500" alt="LOGO"/>
</picture>
</body>
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With