我无法在flutter中使用RESTapi将字符串列表发送到云firestore。{"Authorization": "Bearer ${Utils.loginToken}"}, 在" Facility“之前工作正常,但在插入"Facility: as all other is Stringvalue and Facility is type of List”时出现错误 body: json</e
从API返回的数据是正确的,返回状态代码为200。[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type 'String' is not a subtypeof type 'Map<String, dynamic>'
获取数据的代码
我正在处理从Json到对象数组的动态导入过程。创建一个基于对类对象的字符串引用的List<>会有一点困难。我从REST服务器导入json数据,并使用业务对象列表将json数据映射到可以配置的预定义类。我使用NewtonSoft.Json将数据解析为类。jsonstring from api request
stringjso
我在我的页面中创建了一个initState,并在每次打开这个页面时调用callData来获取favId (类型:列表)。但是,当应用程序启动时,我的编译器显示以下错误消息: _TypeError (type 'List<String>' is not a subtype of type 'String') 这是我的getDataSharedPreferences pref = await SharedPreferences.getInstance();
pref.