需要将Map<String,dynamic>转化成Map<String,String>, 使用as强转编译不会报错,但是运行会抛异常。

使用Map<String, String>.from解决了问题

Flutter报错:type ‘_Map<String, dynamic>‘ is not a subtype of type ‘Map<String, String>‘ in type cast
最新推荐文章于 2023-08-05 09:17:05 发布
需要将Map<String,dynamic>转化成Map<String,String>, 使用as强转编译不会报错,但是运行会抛异常。

使用Map<String, String>.from解决了问题

741
1万+
6885

被折叠的 条评论
为什么被折叠?
