-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SystemChrome setSystemUIOverlayStyle failed #59130
Comments
Hi @weiminghuaa |
Hi @iapicca Thank you for reply. |
|
Code Sample
flutter doctor -v
Could be related #21265 |
Hi I am who mentioned small bug #60050. import 'package:flutter/material.dart';
import 'package:coolme121/screen/LogIn_screen.dart';
import 'package:flutter/services.dart';
class MyApp extends StatelessWidget
{
@override
Widget build(BuildContext context)
{
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
statusBarColor: Colors.green,
statusBarIconBrightness: Brightness.dark,
systemNavigationBarColor: Colors.green,
systemNavigationBarIconBrightness: Brightness.dark,
),
);
return MaterialApp(
debugShowCheckedModeBanner: false,
themeMode: ThemeMode.dark,
darkTheme: ThemeData(
brightness: Brightness.dark,
),
title: 'CoolME',
initialRoute: LogIn.route,
routes:
{
LogIn.route: (context) => LogIn(),
},
);
}
}
and here is my flutter run --verbose: Microsoft Windows [Version 10.0.18363.900]
(c) 2019 Microsoft Corporation. All rights reserved.
D:\code\flutter\coolme121>flutter run --verbose
[ +21 ms] executing: [C:\src\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +86 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 1ad9baa8b99a2897c20f9e6e54d3b9b359ade314
[ ] executing: [C:\src\flutter/] git tag --contains HEAD
[ +237 ms] Exit code 0 from: git tag --contains HEAD
[ +1 ms] 1.17.4
[ +12 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +62 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [C:\src\flutter/] git ls-remote --get-url origin
[ +56 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +134 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref HEAD
[ +68 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +47 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +6 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +47 ms] executing: C:\Users\GL553VD\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +51 ms] List of devices attached
[ +3 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ +49 ms] No supported devices connected.
[ +9 ms] "flutter run" took 302ms.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:336:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:703:11)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:620:33)
<asynchronous suspension>
#4 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart)
#5 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#6 _rootRun (dart:async/zone.dart:1184:13)
#7 _CustomZone.run (dart:async/zone.dart:1077:19)
#8 _runZoned (dart:async/zone.dart:1619:10)
#9 runZoned (dart:async/zone.dart:1539:10)
#10 AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#11 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:610:20)
#12 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#13 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:339:21)
<asynchronous suspension>
#14 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart)
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#16 _rootRun (dart:async/zone.dart:1184:13)
#17 _CustomZone.run (dart:async/zone.dart:1077:19)
#18 _runZoned (dart:async/zone.dart:1619:10)
#19 runZoned (dart:async/zone.dart:1539:10)
#20 AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#21 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:288:19)
#22 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#23 new Future.sync (dart:async/future.dart:224:31)
#24 CommandRunner.run (package:args/command_runner.dart:112:14)
#25 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:231:18)
#26 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:22)
#27 _rootRun (dart:async/zone.dart:1184:13)
#28 _CustomZone.run (dart:async/zone.dart:1077:19)
#29 _runZoned (dart:async/zone.dart:1619:10)
#30 runZonedGuarded (dart:async/zone.dart:1608:12)
#31 runZoned (dart:async/zone.dart:1536:12)
#32 run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
<asynchronous suspension>
#33 run.<anonymous closure> (package:flutter_tools/runner.dart)
#34 runInContext.runnerWrapper (package:flutter_tools/src/context_runner.dart:64:18)
<asynchronous suspension>
#35 runInContext.runnerWrapper (package:flutter_tools/src/context_runner.dart)
#36 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#37 _rootRun (dart:async/zone.dart:1184:13)
#38 _CustomZone.run (dart:async/zone.dart:1077:19)
#39 _runZoned (dart:async/zone.dart:1619:10)
#40 runZoned (dart:async/zone.dart:1539:10)
#41 AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#42 runInContext (package:flutter_tools/src/context_runner.dart:67:24)
#43 run (package:flutter_tools/runner.dart:48:10)
#44 main (package:flutter_tools/executable.dart:69:9)
#45 main (file:///C:/src/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#46 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#47 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
and here is my flutter doctor -v D:\code\flutter\coolme121>flutter doctor -v
[√] Flutter (Channel stable, v1.17.4, on Microsoft Windows [Version 10.0.18363.900], locale en-US)
• Flutter version 1.17.4 at C:\src\flutter
• Framework revision 1ad9baa8b9 (6 days ago), 2020-06-17 14:41:16 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\GL553VD\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 46.0.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.46.1)
• VS Code at C:\Users\GL553VD\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.11.0
[√] Connected device (1 available)
• AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
|
I was able to reproduce on latest master, dev and stable channel. flutter doctor
|
Hi there, this looks like it is working as expected. The AppBar initiates its own SystemChrome with an AnnotatedRegion in order to implement proper contrast. AppBar.systemOverlayStyle allows you to access this built in overlay styling. |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Execute this code, and add
print(_pendingStyle);
insetSystemUIOverlayStyle
functionalway print twice
The text was updated successfully, but these errors were encountered: