Migrate bootstrapping in element embedding sample (#2315)

Migrating the Angular sample is blocked on
https://github.com/flutter/flutter/issues/149443

Contributes to https://github.com/flutter/samples/issues/2297.
pull/2319/head
Parker Lougheed 4 weeks ago committed by GitHub
parent 121d29627a
commit 2b451d2dae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,7 +7,6 @@ environment:
sdk: ^3.4.0-0
dependencies:
cupertino_icons: ^1.0.2
flutter:
sdk: flutter

@ -162,7 +162,7 @@ h1 {
}
#flutter_target.resize {
width: 480px;
height: 320px;
height: 336px;
}
#flutter_target.spin { animation: spin 6400ms ease-in-out infinite; }
#flutter_target.shadow { position: relative; }

@ -20,9 +20,6 @@
<title>Element embedding</title>
<link rel="manifest" href="manifest.json" />
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
@ -81,17 +78,17 @@
</section>
<script>
window.addEventListener("load", function (ev) {
// Embed flutter into div#flutter_target
let target = document.querySelector("#flutter_target");
_flutter.loader.loadEntrypoint({
onEntrypointLoaded: async function (engineInitializer) {
let appRunner = await engineInitializer.initializeEngine({
hostElement: target,
});
await appRunner.runApp();
},
});
{{flutter_js}}
{{flutter_build_config}}
const target = document.getElementById('flutter_target');
_flutter.loader.load({
onEntrypointLoaded: async function (engineInitializer) {
const appRunner = await engineInitializer.initializeEngine({
hostElement: target,
});
await appRunner.runApp();
}
});
</script>
<script src="js/demo-js-interop.js" defer></script>

Loading…
Cancel
Save