browser load time improvements

This commit is contained in:
2024-09-11 10:14:41 +02:00
parent c5e40aea8f
commit 687a28f158
3 changed files with 20 additions and 11 deletions

View File

@@ -304,7 +304,7 @@ class _SignInState extends State<SignIn> {
const SizedBox(height: 10), const SizedBox(height: 10),
//Heading //Heading
Text( Text(
'Sign In', 'Sign In Now',
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

View File

@@ -132,7 +132,7 @@ flutter_native_splash:
# The image parameter allows you to specify an image used in the splash screen. It must be a # The image parameter allows you to specify an image used in the splash screen. It must be a
# png file and should be sized for 4x pixel density. # png file and should be sized for 4x pixel density.
image: images\logo_light.png image: images/logo_light.png
# The branding property allows you to specify an image used as branding in the splash screen. # The branding property allows you to specify an image used as branding in the splash screen.
# It must be a png file. It is supported for Android, iOS and the Web. For Android 12, # It must be a png file. It is supported for Android, iOS and the Web. For Android 12,

View File

@@ -19,8 +19,13 @@
<title>Mzansi Innovation Hub</title> <title>Mzansi Innovation Hub</title>
<link rel="manifest" href="manifest.json"> <link rel="manifest" href="manifest.json">
<!-- test stuff for speed -->
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
<link rel="prefetch" href="flutter_bootstrap.js">
<style id="splash-screen-style"> <!-- Splash screen -->
<style id="splash-screen-style" defer>
html { html {
height: 100% height: 100%
} }
@@ -78,13 +83,14 @@
right: 0; right: 0;
} }
</style> </style>
<script id="splash-screen-script"> <script id="splash-screen-script" defer>
function removeSplashFromWeb() { function removeSplashFromWeb() {
document.getElementById("splash")?.remove(); document.getElementById("splash")?.remove();
document.getElementById("splash-branding")?.remove(); document.getElementById("splash-branding")?.remove();
document.body.style.background = "transparent"; document.body.style.background = "transparent";
} }
</script> </script>
<!--------------------->
</head> </head>
<body> <body>
<picture id="splash-branding"> <picture id="splash-branding">
@@ -98,15 +104,9 @@
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt=""> <img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
</picture> </picture>
<!-- File Picker & PDF viewer -->
<script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js"></script>
<script type="text/javascript">
pdfjsLib.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.worker.min.js";
</script>
<!-- Versioning --> <!-- Versioning -->
<!-- <script src="flutter_bootstrap.js?v0.0.0.40" async></script> --> <!-- <script src="flutter_bootstrap.js?v0.0.0.40" async></script> -->
<script> <script defer>
var serviceWorkerVersion = '{{flutter_service_worker_version}}'; var serviceWorkerVersion = '{{flutter_service_worker_version}}';
var scriptLoaded = false; var scriptLoaded = false;
function loadMainDartJs() { function loadMainDartJs() {
@@ -117,6 +117,7 @@
var scriptTag = document.createElement('script'); var scriptTag = document.createElement('script');
scriptTag.src = 'flutter_bootstrap.js'; scriptTag.src = 'flutter_bootstrap.js';
scriptTag.type = 'application/javascript'; scriptTag.type = 'application/javascript';
scriptTag.defer = true;
document.body.append(scriptTag); document.body.append(scriptTag);
} }
@@ -187,4 +188,12 @@
</script> </script>
</body> </body>
<!-- File Picker & PDF viewer -->
<!-- <script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js" defer></script>
<script type="text/javascript" defer>
pdfjsLib.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.worker.min.js";
</script> -->
<script id="pdfjs-lib" src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js" defer></script>
<script id="pdfjs-worker" type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.worker.min.js" defer></script>
<!--------------------->
</html> </html>