朋友, 我正在使用以下方法从WebService检索信息,这将向我返回MAP Future&#706Map&#706String,字符串>> recoveryTypesBenefits()异步{...
我想在DropDown中使用它,并且尝试按以下方式恢复它:
DropdownButton (
isExpanded: false,
value: dropdownValueBeneficios,
items: (recoverTypesBenefits () as Map <String, String>). entries.map <DropdownMenuItem <String>> ((entry) {...
但是我得到的反馈是:
类型'Future&#706Map&#706String,String >>'不是强制类型转换中类型'Map&#706String,String>'的子类型
我认为MAP&#706String,String>都不会出错。
详细信息: 直接在FUTURE外部创建MAP
Map <String, String> tipos = {"": "- Select the type of benefit -"};
,并以此方式调用 项目:tipos.entries.map&#706DropdownMenuItem&#706String >>((entry){... 我正确地恢复了数据。但是这样我不会动态访问它, Web服务。
有人可以帮忙吗? 谢谢!