解析flutter应用程序中通过firebase消息传递接收的JSON数据

pvcm50d1  于 2022-12-15  发布在  Flutter
关注(0)|答案(1)|浏览(114)

enter image description here这是我在解码json时通过通知获得的json响应,我得到了一个错误
我尝试的方法

var data = message.data;
Map<String, dynamic> data1 = json.decode(data);

the error I got on json.decode(data);

The argument type 'Map<String, dynamic>' can't be assigned to the parameter type 'String'
lymnna71

lymnna711#

从此处检查Json格式jsonlint.com是否一切正常
然后使用这个站点json_to_dart构建您的模型,fromJson和toJson方法

相关问题