Skip to content
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

Error when getDisplays #8

Open
dariocf1 opened this issue Jun 24, 2021 · 2 comments
Open

Error when getDisplays #8

dariocf1 opened this issue Jun 24, 2021 · 2 comments

Comments

@dariocf1
Copy link

dariocf1 commented Jun 24, 2021

When getDisplays is called a error is throwed: type 'Null' is not a subtype of type 'int'

  • Device: Android Tablet
  • Version 7.1.2

try { final values = await displayManager.getDisplays(); print(values); } catch (error) { print(error); }

The _displayMethodChannel?.invokeMethod returns:
[{a: 0, b: 3, c: 0, d: Built-in Screen}, {a: 1, b: 11, c: 0, d: HDMI Screen}]

But the displayFromJson expects a json with "displayId", "flags", "name", "rotation", instead receives "a", "b", "c", "d" fields.

@arbyazra123
Copy link

hi, I fixed this issue by using klutzy way haha,
try this https://github.com/arbyazra123/presentation-displays,
I changed the parameter in native android to a = displayId, b = flags, c = rotation, d = displayName

@MUSA-19542
Copy link

I have solved & Added Custom Methods
Go & check
https://github.com/MUSA-19542/FlutterCustom/tree/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants