-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.19Found to occur in 3.19Found to occur in 3.19found in release: 3.20Found to occur in 3.20Found to occur in 3.20frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamOwned by the Linux platform teamtriaged-linuxTriaged by the Linux platform teamTriaged by the Linux platform team
Description
Steps to reproduce
Retrieving the display size on linux via WidgetsBinding.instance.platformDispatcher.views.first.display.size yields an assertion.
Expected results
Size object containing both the horizontal and vertical size of the display in px
Actual results
Assertion: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'dart:ui/window.dart': Failed assertion: line 103 pos 12: '<optimized out>': is not true.
Code sample
Code sample
void main() {
WidgetsFlutterBinding.ensureInitialized();
print(WidgetsBinding.instance.platformDispatcher.views.first.display.size);
runApp(const App());
}Logs
Logs
Gdk-CRITICAL **: 16:54:02.234: gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'dart:ui/window.dart': Failed assertion: line 103 pos 12: '<optimized out>': is not true.
#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2 FlutterView.display (dart:ui/window.dart:103:12)
#3 Enviroment.init (package:nicer_dicer/environment.dart:37:51)
#4 main (package:nicer_dicer/main_online.dart:8:14)
#5 _runMain.<anonymous closure> (dart:ui/hooks.dart:301:23)
#6 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#7 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.16.4, on openSUSE Tumbleweed 6.7.6-1-default, locale en_US.UTF-8)
• Flutter version 3.16.4 on channel stable at /SDK/flutter
• Framework revision 2e9cb0aa71 (3 months ago), 2023-12-11 14:35:13 -0700
• Engine revision 54a7145303
• Dart version 3.2.3
• DevTools version 2.28.4
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /SDK/Android/Sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /SDK/Android/Sdk
• ANDROID_SDK_ROOT = /SDK/Android/Sdk/
• Java binary at: /SDK/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /usr/bin/chromium-browser
[✓] Linux toolchain - develop for Linux desktop
• clang version 17.0.6
• cmake version 3.28.1
• ninja version 1.11.1
• pkg-config version 2.1.1
[✓] Android Studio (version 2022.3)
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • openSUSE Tumbleweed 6.7.6-1-default
• Chrome (web) • chrome • web-javascript • Chromium 120.0.6099.224 stable
[✓] Network resources
• All expected network resources are available.
• No issues found!Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.19Found to occur in 3.19Found to occur in 3.19found in release: 3.20Found to occur in 3.20Found to occur in 3.20frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamOwned by the Linux platform teamtriaged-linuxTriaged by the Linux platform teamTriaged by the Linux platform team