Comments (7)
Okay, I'll try to reproduce your error.
even if the lcd_rotate=2
I recommend not using the linux or raspberry pi firmware settings to rotate the display, the rotation is entirely done by flutter-pi. Also, at least in my experience, most of the display settings inside config.txt
are kinda hacky and glitchy
from flutter-pi.
Hi,
first of all, this is a really great project. Thank you very much for making it available to everybody!
I have the same problem here. It happens without any modification in config.tx
. If I start my flutter app in landscape mode everything works like a charm.
But if I add await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
to my flutter application it stops after the startup animation and changes to dark colors.
I have a Raspi4 with 4GB Ram and the official 7" LCD touch Dislplay.
Do you have any hints how to find the cause?
from flutter-pi.
I can confirm this same issue - not on a Raspberry Pi but on an i.MX 6 device.
Flutter application displays black screen after adding setPreferredOrientations.
from flutter-pi.
Weird, it works fine for me. I created a brand-new barebones flutter project using flutter create
and put the call to setPreferredOrientations
into the initState
and build
methods.
Can anyone send me some more code so I can reproduce the issue?
from flutter-pi.
I'm using the example from https://github.com/google/flutter-desktop-embedding/tree/master/example adding await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
before runApp(new MyApp());
.
from flutter-pi.
When I put the SystemChrome.setPreferredOrientations
call before runApp
this error message is printed:
[ERROR:engine/src/flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
If you're running an application and need to access the binary messenger before `runApp()` has been called (for example, during plugin initialization), then you need to explicitly call the `WidgetsFlutterBinding.ensureInitialized()` first.
If you're running a test, you can call the `TestWidgetsFlutterBinding.ensureInitialized()` as the first line in your test's `main()` method to initialize the binding.
#0 defaultBinaryMessenger.<anonymous closure> (package:flutter/src/services/binary_messenger.dart:76:7)
#1 defaultBinaryMessenger (package:flutter/src/services/binary_messenger.dart:89:4)
#2 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:140:62)
#3 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:35)
#4 OptionalMethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:429:36)
#5 SystemChrome.setPreferredOrientations (package:flutter/src/services/system_chrome.dart:236:35)
#6 main (package:orientation/main.dart:8:6)
#7 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:239:25)
#8 _rootRun (dart:async/zone.dart:1126:13)
#9 _CustomZone.run (dart:async/zone.dart:1023:19)
#10 _runZoned (dart:async/zone.dart:1518:10)
#11 runZoned (dart:async/zone.dart:1502:12)
#12 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:231:5)
#13 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307:19)
#14 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
As it says in the error message, just don't use SystemChrome.setPreferredOrientations
before the runApp
call.
runApp
initializes the bindings to the platform side. SystemChrome.setPreferredOrientations
needs these bindings to be initialized, since it uses these bindings to tell the platform side about the preferred orientations. I think, in general, it's a bad idea to do flutter-specific stuff before the runApp
call.
from flutter-pi.
Sorry for this late response. I tried to create a minimal version to reproduce the issue, as my project is quite sensitive. As a result I found that the issue is caused by Flutter. So from my side the issue is not an flutter_pi issue. I'm sorry for the inconvenience.
And thank you for this great project!
from flutter-pi.
Related Issues (20)
- error message on TI AM625
- How can I show a python plot? (Question) HOT 2
- No issue, just looking for some help: Can't load Kernel binary: Invalid kernel binary format version. HOT 1
- No mouse cursor on Ubuntu HOT 1
- I updated the flutter version and reported the following error.(3.19.3) HOT 3
- modesetting.c: Could not set DRM client universal planes capable. drmSetClientCap: Operation not supported HOT 1
- Pi goes back to console mode but the app is running
- Option --dimensions does not take effect HOT 1
- 🐛 throwing DRM and GBM errors w/ latest kernel HOT 5
- Does webview work?
- screen ratio not respected. HOT 2
- MissingPluginException - method setSourceBytes (audioplayers) HOT 2
- error: static assignment failed: Expressionevaluation to false HOT 2
- No output on Odroid M1S when using Vu5S MIPI-DSI display HOT 14
- error: Couldn't create GBM surface for rendering - Rasberry pi 5 with 7 inch DSI official display HOT 6
- Missing Depens in Readme ? HOT 2
- Different resolution in flutter-pi than that of the OS (DSI panel) HOT 4
- Installing on iMX6ULL HOT 6
- Audioplayers MissingPluginException HOT 1
- Orange Pi Zero 3 configuration HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-pi.