Visitar URL original
Add loading indicator web template by YazeedAlKhalaf · Pull Request #85464 · flutter/flutter · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
➕ Add loading indicator for index.html web template
  • Loading branch information
YazeedAlKhalaf committed Jun 27, 2021
commit 309a68612e456da71861d321b1299980830ea850
40 changes: 40 additions & 0 deletions packages/flutter_tools/templates/app/web/index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,48 @@

<title>{{projectName}}</title>
<link rel="manifest" href="manifest.json">

<!-- This style is for making the loading indicator work -->
<style>
.loading-indicator-container {
height: 98vh;

display: flex;
justify-content: center;
align-items: center;
}

.loading-indicator {
width: 48px;
height: 48px;

border-top: 5px solid #0175C2;
border-bottom: 5px solid #0175C2;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
border-radius: 50%;
animation: loading-indicator-spin 2s linear infinite;
}

@keyframes loading-indicator-spin {
0% {
transform: rotate(0deg);
}

100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>

<!-- This div, aka container, will show a loading indicator before the
Flutter app is loaded. -->
<div class="loading-indicator-container">
<div class="loading-indicator"></div>
</div>

<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
Expand Down