flutter - 参数类型'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(),
),
);
解决方案
推荐阅读
- javascript - 存储和更新存储的对象
- drop-down-menu - bootstrap 4.1 navbar-collapse nav-second-level 和 nav-third-level
- json - 需要读取嵌套的 Json 并使用 scala 中的数据框将其解析为两列(Id,newId)
- google-analytics - 谷歌分析,会话计数
- c# - 通过服务上传并获取较大文件上不可用的消息端点
- abap - 我如何在abap中拆分多次?
- eiffel - Eiffel:void safety,一种简洁的方法来测试一个对象是否存在,然后调用它的特征
- angularjs - 为什么在选择中切换'多个'属性时ngModel'null'?
- python - 向 pyplot 添加颜色条
- laravel - 数据未提交到数据库