Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 颤振:访问同一小部件中的两个firecast集合_Dart_Flutter - Fatal编程技术网

Dart 颤振:访问同一小部件中的两个firecast集合

Dart 颤振:访问同一小部件中的两个firecast集合,dart,flutter,Dart,Flutter,我是个新手,我正在尝试在同一个小部件中使用firebase firecast中的两个集合。但我不能适应它 颤振文档提供了一个适合小部件引用的StreamBuilder return new StreamBuilder<Event>( stream: FirebaseDatabase.instance.reference().child('schedules').onValue, builder: (BuildContext context, AsyncSnapshot<

我是个新手,我正在尝试在同一个小部件中使用firebase firecast中的两个集合。但我不能适应它

颤振文档提供了一个适合小部件引用的StreamBuilder

return new StreamBuilder<Event>(
  stream: FirebaseDatabase.instance.reference().child('schedules').onValue,
  builder: (BuildContext context, AsyncSnapshot<Event> event) {
    if (!event.hasData)
      return new Center(child: new Text('Loading...'));
      Map<String, Map> schedules = event.data.snapshot.value;
     // Do something with the list of schedules
})
返回新的StreamBuilder(
流:FirebaseDatabase.instance.reference().child('schedules').onValue,
生成器:(BuildContext上下文,异步快照事件){
如果(!event.hasData)
返回新中心(子对象:新文本('Loading…'));
映射计划=event.data.snapshot.value;
//对时间表列表做些什么
})
我的期望输出:


我正在尝试实现此方案。

只需将其包装在一列中,然后添加另一个StreamBuilder:

Column(
  children: <Widget>[
    StreamBuilder(...),
    StreamBuilder(...),
  ],
)
列(
儿童:[
StreamBuilder(…),
StreamBuilder(…),
],
)