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' ;
14import 'package:flutter/foundation.dart' ;
25import 'package:flutter/material.dart' ;
3- import 'package:device_preview/device_preview.dart' ;
46import 'package:ht_main/app/config/config.dart' ;
57import 'package:ht_main/bootstrap.dart' ;
68
@@ -9,6 +11,9 @@ import 'package:ht_main/bootstrap.dart';
911// production/development/demo
1012const currentEnvironment = AppEnvironment .demo;
1113
14+ @JS ('removeSplashFromWeb' )
15+ external void removeSplashFromWeb ();
16+
1217void main () async {
1318 final appConfig = switch (currentEnvironment) {
1419 AppEnvironment .production => AppConfig .production (),
@@ -18,13 +23,17 @@ void main() async {
1823
1924 final appWidget = await bootstrap (appConfig);
2025
26+ // Only remove the splash screen on web after the app is ready.
27+ if (kIsWeb) {
28+ removeSplashFromWeb ();
29+ }
30+
2131 if (appConfig.environment == AppEnvironment .demo) {
2232 runApp (
2333 DevicePreview (
2434 enabled: true ,
2535 builder: (context) => appWidget,
2636 tools: const [DeviceSection ()],
27-
2837 ),
2938 );
3039 } else {
You can’t perform that action at this time.
0 commit comments