Closed Mo0Khaled closed 1 year ago
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']);
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?
so, the issue is
the value returned from the map is
String, Bool
not String , int
still get the same issue !
but with map<string,bool>
I suggest we loop over the map["peersStatus"] and cast each key, value?
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?