Flutter报错:type ‘_Map<String, dynamic>‘ is not a subtype of type ‘Map<String, String>‘ in type cast

需要将Map<String,dynamic>转化成Map<String,String>, 使用as强转编译不会报错,但是运行会抛异常。
在这里插入图片描述
使用Map<String, String>.from解决了问题
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Memory_of_the_wind/article/details/130800456