' 不能分配给参数类型 'QuerySnapshot,flutter,google-cloud-firestore"/>

首页 > 解决方案 > 参数类型'Map' 不能分配给参数类型 'QuerySnapshot

问题描述

这是在“home.dart”文件的构建中编写的代码。该文件在登录或发生注册并且当前已登录时打开。

return StreamProvider<QuerySnapshot>.value(
      initialData:{'sugars':0,'name':"new user","strength":100},
      value: DatabaseService(uid: '').brews,
      child: Scaffold(
        appBar: AppBar(title: Text("Home Screen"),
        actions: [
          ElevatedButton.icon(onPressed: ()async{
            print("clicked here");
            await _auth.signOut(); 
          }, icon: Icon(Icons.person), label: Text("Logout")),
        ],),
        body: BrewList(),
      ),
    );

标签: fluttergoogle-cloud-firestore

解决方案


推荐阅读