File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ import 'dart:js_interop' ;
2
+
3
+ import 'package:device_preview/device_preview.dart' ;
1
4
import 'package:flutter/foundation.dart' ;
2
5
import 'package:flutter/material.dart' ;
3
- import 'package:device_preview/device_preview.dart' ;
4
6
import 'package:ht_main/app/config/config.dart' ;
5
7
import 'package:ht_main/bootstrap.dart' ;
6
8
@@ -9,6 +11,9 @@ import 'package:ht_main/bootstrap.dart';
9
11
// production/development/demo
10
12
const currentEnvironment = AppEnvironment .demo;
11
13
14
+ @JS ('removeSplashFromWeb' )
15
+ external void removeSplashFromWeb ();
16
+
12
17
void main () async {
13
18
final appConfig = switch (currentEnvironment) {
14
19
AppEnvironment .production => AppConfig .production (),
@@ -18,13 +23,17 @@ void main() async {
18
23
19
24
final appWidget = await bootstrap (appConfig);
20
25
26
+ // Only remove the splash screen on web after the app is ready.
27
+ if (kIsWeb) {
28
+ removeSplashFromWeb ();
29
+ }
30
+
21
31
if (appConfig.environment == AppEnvironment .demo) {
22
32
runApp (
23
33
DevicePreview (
24
34
enabled: true ,
25
35
builder: (context) => appWidget,
26
36
tools: const [DeviceSection ()],
27
-
28
37
),
29
38
);
30
39
} else {
You can’t perform that action at this time.
0 commit comments