Skip to content

Commit 8e7c18f

Browse files
committed
fix: web build error.
1 parent e7e5d5a commit 8e7c18f

12 files changed

Lines changed: 54 additions & 103 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.1
2+
3+
- fix: web build error.
4+
15
## 0.3.0
26

37
* [windows] Add MSIX app support

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 LiJianying <lijy91@foxmail.com>
3+
Copyright (c) 2023-2024 LiJianying <lijy91@foxmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README-ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
```yaml
5151
dependencies:
52-
launch_at_startup: ^0.2.2
52+
launch_at_startup: ^0.3.1
5353
```
5454
5555

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Add this to your package's pubspec.yaml file:
4949

5050
```yaml
5151
dependencies:
52-
launch_at_startup: ^0.2.2
52+
launch_at_startup: ^0.3.1
5353
```
5454
5555
Or

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include: package:mostly_reasonable_lints/flutter.yaml
1+
include: package:mostly_reasonable_lints/analysis_options.yaml

example/.metadata

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled.
4+
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
8-
channel: unknown
7+
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
8+
channel: "stable"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
17-
base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
16+
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
17+
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
1818
- platform: web
19-
create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
20-
base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
19+
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
20+
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
2121

2222
# User provided section
2323

example/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include: package:mostly_reasonable_lints/flutter.yaml
1+
include: package:mostly_reasonable_lints/analysis_options.yaml

example/pubspec.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -166,39 +166,39 @@ packages:
166166
path: ".."
167167
relative: true
168168
source: path
169-
version: "0.3.0"
169+
version: "0.3.1"
170170
leak_tracker:
171171
dependency: transitive
172172
description:
173173
name: leak_tracker
174-
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
174+
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
175175
url: "https://pub.dev"
176176
source: hosted
177-
version: "10.0.0"
177+
version: "10.0.4"
178178
leak_tracker_flutter_testing:
179179
dependency: transitive
180180
description:
181181
name: leak_tracker_flutter_testing
182-
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
182+
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
183183
url: "https://pub.dev"
184184
source: hosted
185-
version: "2.0.1"
185+
version: "3.0.3"
186186
leak_tracker_testing:
187187
dependency: transitive
188188
description:
189189
name: leak_tracker_testing
190-
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
190+
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
191191
url: "https://pub.dev"
192192
source: hosted
193-
version: "2.0.1"
193+
version: "3.0.1"
194194
lints:
195195
dependency: transitive
196196
description:
197197
name: lints
198-
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
198+
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
199199
url: "https://pub.dev"
200200
source: hosted
201-
version: "3.0.0"
201+
version: "4.0.0"
202202
matcher:
203203
dependency: transitive
204204
description:
@@ -219,18 +219,18 @@ packages:
219219
dependency: transitive
220220
description:
221221
name: meta
222-
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
222+
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
223223
url: "https://pub.dev"
224224
source: hosted
225-
version: "1.11.0"
225+
version: "1.12.0"
226226
mostly_reasonable_lints:
227227
dependency: "direct dev"
228228
description:
229229
name: mostly_reasonable_lints
230-
sha256: c61cc6b211f54188eef15e0ad7c9b00e8c001478ac253a52036ef7391b532b7c
230+
sha256: e19fec63536866ba307b3dfbc258b4bce9b3745129f038006b56b4067c6293d8
231231
url: "https://pub.dev"
232232
source: hosted
233-
version: "0.1.1"
233+
version: "0.1.2"
234234
msix:
235235
dependency: "direct dev"
236236
description:
@@ -291,10 +291,10 @@ packages:
291291
dependency: "direct main"
292292
description:
293293
name: preference_list
294-
sha256: d3419b2ec57a6ad2156bd682a46cf3194bf162b36bb013790c7b29e6438f107a
294+
sha256: "1429f8fe03605d5eaf6dc333208d7bbf028bae707c3c1c32386939e4d7f58154"
295295
url: "https://pub.dev"
296296
source: hosted
297-
version: "0.0.1"
297+
version: "0.0.2"
298298
pub_semver:
299299
dependency: transitive
300300
description:
@@ -352,10 +352,10 @@ packages:
352352
dependency: transitive
353353
description:
354354
name: test_api
355-
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
355+
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
356356
url: "https://pub.dev"
357357
source: hosted
358-
version: "0.6.1"
358+
version: "0.7.0"
359359
typed_data:
360360
dependency: transitive
361361
description:
@@ -376,10 +376,10 @@ packages:
376376
dependency: transitive
377377
description:
378378
name: vm_service
379-
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
379+
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
380380
url: "https://pub.dev"
381381
source: hosted
382-
version: "13.0.0"
382+
version: "14.2.1"
383383
web:
384384
dependency: transitive
385385
description:

example/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ environment:
66
sdk: ">=3.0.0 <4.0.0"
77

88
dependencies:
9-
bot_toast: ^4.0.1
9+
bot_toast: ^4.1.3
1010
cupertino_icons: ^1.0.2
1111
flutter:
1212
sdk: flutter
1313
launch_at_startup:
1414
path: ../
1515
package_info_plus: ^8.0.0
16-
preference_list: ^0.0.1
16+
preference_list: ^0.0.2
1717

1818
dev_dependencies:
1919
flutter_test:
2020
sdk: flutter
21-
mostly_reasonable_lints: ^0.1.1
21+
mostly_reasonable_lints: ^0.1.2
2222
msix: ^3.16.7
2323

2424
flutter:

example/web/index.html

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -33,72 +33,6 @@
3333
<link rel="manifest" href="manifest.json">
3434
</head>
3535
<body>
36-
<!-- This script installs service_worker.js to provide PWA functionality to
37-
application. For more information, see:
38-
https://developers.google.com/web/fundamentals/primers/service-workers -->
39-
<script>
40-
var serviceWorkerVersion = null;
41-
var scriptLoaded = false;
42-
function loadMainDartJs() {
43-
if (scriptLoaded) {
44-
return;
45-
}
46-
scriptLoaded = true;
47-
var scriptTag = document.createElement('script');
48-
scriptTag.src = 'main.dart.js';
49-
scriptTag.type = 'application/javascript';
50-
document.body.append(scriptTag);
51-
}
52-
53-
if ('serviceWorker' in navigator) {
54-
// Service workers are supported. Use them.
55-
window.addEventListener('load', function () {
56-
// Wait for registration to finish before dropping the <script> tag.
57-
// Otherwise, the browser will load the script multiple times,
58-
// potentially different versions.
59-
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
60-
navigator.serviceWorker.register(serviceWorkerUrl)
61-
.then((reg) => {
62-
function waitForActivation(serviceWorker) {
63-
serviceWorker.addEventListener('statechange', () => {
64-
if (serviceWorker.state == 'activated') {
65-
console.log('Installed new service worker.');
66-
loadMainDartJs();
67-
}
68-
});
69-
}
70-
if (!reg.active && (reg.installing || reg.waiting)) {
71-
// No active web worker and we have installed or are installing
72-
// one for the first time. Simply wait for it to activate.
73-
waitForActivation(reg.installing || reg.waiting);
74-
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
75-
// When the app updates the serviceWorkerVersion changes, so we
76-
// need to ask the service worker to update.
77-
console.log('New service worker available.');
78-
reg.update();
79-
waitForActivation(reg.installing);
80-
} else {
81-
// Existing service worker is still good.
82-
console.log('Loading app from service worker.');
83-
loadMainDartJs();
84-
}
85-
});
86-
87-
// If service worker doesn't succeed in a reasonable amount of time,
88-
// fallback to plaint <script> tag.
89-
setTimeout(() => {
90-
if (!scriptLoaded) {
91-
console.warn(
92-
'Failed to load app from service worker. Falling back to plain <script> tag.',
93-
);
94-
loadMainDartJs();
95-
}
96-
}, 4000);
97-
});
98-
} else {
99-
// Service workers not supported. Just drop the <script> tag.
100-
loadMainDartJs();
101-
}
102-
</script>
36+
<script src="flutter_bootstrap.js" async></script>
10337
</body>
10438
</html>

0 commit comments

Comments
 (0)