我可以就这个错误向您寻求帮助当我第一次尝试使用 flutter run -d chrome 运行我的 flutter web 时会发生这种情况
Launching lib\main.dart on Chrome in debug mode...
Syncing files to device Chrome...
25,220ms (!)
GET /dwds/src/injected/client.js
Error thrown by handler.
FileSystemException: Cannot open file, path = 'C:\Users\Acer\flutter\.pub-cache\hosted\pub.dartlang.org\dwds-2.0.1\lib\src\injected\client.js' (OS Error: The system cannot find the path specified.
, errno = 3)
dart:isolate _RawReceivePortImpl._handleMessage
Run Code Online (Sandbox Code Playgroud)
如果我尝试使用
flutter run -d web
Run Code Online (Sandbox Code Playgroud)
它没有抛出任何错误,但在网站上它变成空白白色没有显示任何内容。无论如何感谢您的帮助
当时我的状态栏是可见的,但是在我使用flutter_native_splash和flutter_launcher_icons包之后
它就消失了。
我已经尝试在构建方法中使用 SystemChrome 或运行方法不起作用
SystemChrome.setEnabledSystemUIOverlays(
SystemUiOverlay.values);
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Colors.transparent));
Run Code Online (Sandbox Code Playgroud)
有人知道会发生什么吗?
我的构建小部件
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays(
SystemUiOverlay.values);
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Colors.white));
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
return MultiProvider(
providers: [
ChangeNotifierProvider.value(
value: SeedProvider(),
),
ChangeNotifierProvider.value(
value: SurgeryProvider(),
),
ChangeNotifierProvider.value(
value: CookingProvider(),
),
ChangeNotifierProvider.value(
value: FishingProvider(),
),
ChangeNotifierProvider.value(
value: CombiningProvider(),
),
ChangeNotifierProvider.value(
value: CrystalsProvider(),
)
],
child: MaterialApp(
title: 'Grow Guides',
theme: ThemeData(
primaryColorBrightness: Brightness.light,
primarySwatch: Colors.teal,
appBarTheme: AppBarTheme(
textTheme: Theme.of(context)
.textTheme
.apply(bodyColor: Colors.white, displayColor: Colors.white),
iconTheme: IconThemeData(color: Colors.white)), …Run Code Online (Sandbox Code Playgroud)