由于messages_pure是一个List类型的变量,你无法将一个String类型的数据添加到它里面。解决这个问题的一种方法是,将messages_pure声明为一个String类型的变量,而不是List类型的变量。修改代码如下:

String messages_pure = ""; messages_pure += "gpt: " + response.data.toString();

static ListString messages_pure = ;messages_pureaddgpt + responsedatatoString;报错Unhandled Exception type String is not a subtype of type ListString of function result 应该如何更改

原文地址: http://www.cveoy.top/t/topic/B0E 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录