Skip to content

Commit

Permalink
fix(web): upgrade web index.html file
Browse files Browse the repository at this point in the history
  • Loading branch information
zeshuaro committed Sep 4, 2024
1 parent 5904815 commit dbd558e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
14 changes: 7 additions & 7 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72
channel: stable
revision: "5874a72aa4c779a02553007c47dacbefba2374dc"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72
base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: web
create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72
base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc

# User provided section

Expand Down
34 changes: 15 additions & 19 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,24 @@

<title>Appainter</title>
<link rel="manifest" href="manifest.json" />
<script>
var serviceWorkerVersion = null;
</script>
<script src="flutter.js" defer></script>
</head>
<body>
<div id="loading"></div>
<script>
window.addEventListener("load", function (ev) {
var loading = document.querySelector("#loading");
_flutter.loader
.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
})
.then(function (engineInitializer) {
return engineInitializer.initializeEngine();
})
.then(function (appRunner) {
return appRunner.runApp();
});
{{flutter_bootstrap_js}}
{{flutter_js}}
{{flutter_build_config}}

const loading = document.createElement('div');
document.body.appendChild(loading);
loading.textContent = "Loading...";
_flutter.loader.load({
onEntrypointLoaded: async function(engineInitializer) {
loading.textContent = "Loading...";
const appRunner = await engineInitializer.initializeEngine();

loading.textContent = "Starting Appainter...";
await appRunner.runApp();
}
});
</script>
</body>
Expand Down

0 comments on commit dbd558e

Please sign in to comment.