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

Unhandled Exception when calling onPeersOnlineStatusChanged #146

Closed
Mo0Khaled opened this issue Jun 4, 2023 · 2 comments
Closed

Unhandled Exception when calling onPeersOnlineStatusChanged #146

Mo0Khaled opened this issue Jun 4, 2023 · 2 comments

Comments

@Mo0Khaled
Copy link

I am getting an Exception :

type '_Map<Object?, Object?>' is not a subtype of type 'Map<String, int>'

I think this is because

this line
final map = Map.from(event['data']);

will be Map<Object?, Object?>

and you are parsing it like that :

Map<String, int> peersStatus = map["peersStatus"];

so it will throw this error.

can I make a pull request on it ?

or can I solved in other way?

@Mo0Khaled
Copy link
Author

so, the issue is

the value returned from the map is

String, Bool

not String , int

@Mo0Khaled
Copy link
Author

still get the same issue !

but with map<string,bool>

I suggest we loop over the map["peersStatus"] and cast each key, value?

LichKing-2234 added a commit that referenced this issue Jun 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* feat: Flutter - Specify AreaCode in RTM #87

* ci: test flutter 2.5.0

* ci: fix

* ci: fix

* ci: fix
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

2 participants