static ListString messages_pure = ; Globalmessages_pureaddai + responsedata;报错 type String is not a subtype of type ListString of function result
这个错误提示表明,将一个字符串添加到一个列表中时发生了类型不匹配的错误。具体来说,代码中的 Global.messages_pure 是一个列表,而 messages_pure.add() 方法期望接收一个字符串类型的参数来添加到列表中。然而,在代码中使用了 Global.messages_pure.add() 方法,这个方法返回的是一个函数结果,而不是字符串类型的参数,因此导致了类型不匹配的错误。
要修复这个错误,可以将代码中的 Global.messages_pure.add() 方法改为 Global.messages_pure.add(response.data),这样就可以将 response.data 字符串添加到 messages_pure 列表中了。
原文地址: http://www.cveoy.top/t/topic/B0v 著作权归作者所有。请勿转载和采集!