jjzjj

getGames

全部标签

firebase - flutter 错误 : type 'Future<dynamic>' is not a subtype of type 'List<Game>'

我正在尝试构建一个包含不同游戏列表的应用。作为后端,我使用Firebase并且连接工作正常,我对其进行了测试。无论如何,我在用来自firebase的真实数据替换模拟数据时遇到了问题。我总是收到此错误:type'Future'isnotasubtypeoftype'List'我有以下功能:getGames()async{ListnewGamesList=[];QuerySnapshotresult=awaitFirestore.instance.collection('products').getDocuments();Listdocuments=result.documents;doc

firebase - flutter 错误 : type 'Future<dynamic>' is not a subtype of type 'List<Game>'

我正在尝试构建一个包含不同游戏列表的应用。作为后端,我使用Firebase并且连接工作正常,我对其进行了测试。无论如何,我在用来自firebase的真实数据替换模拟数据时遇到了问题。我总是收到此错误:type'Future'isnotasubtypeoftype'List'我有以下功能:getGames()async{ListnewGamesList=[];QuerySnapshotresult=awaitFirestore.instance.collection('products').getDocuments();Listdocuments=result.documents;doc