【发布时间】:2021-09-11 07:20:00
【问题描述】:
访问数据时 _buildStoryPage(Map code here
StreamBuilder(
stream: slides,
initialData: [],
builder: (BuildContext context, AsyncSnapshot snap){
List slideList=snap.data.toList();
return PageView.builder(
controller: ctrl,
itemCount: slideList.length+1,
itemBuilder:(context,int currentIndex){
if(currentIndex==0){
return _buildTagPage();
}
else if (slideList.length>=currentIndex){
bool active=currentIndex==currentPage;
//error at this line
return _buildStoryPage(slideList[currentIndex-1],active);
}
return Loader();
}
);
},
),
Stream _queryDb({String tag="New"}){
Query query=db.collection('Stories').where("tag",arrayContains: tag);
slides =query.snapshots().map((list)=>list.docs.map((d)=>d.data));
setState(() {
activeTag=tag;
});
}
_buildStoryPage( Map<String, dynamic> data,bool active){
// while providing the value to _buildStoryPage(slideList[currentIndex-1],active) its error
//type '() => Map<String, dynamic>' is not a subtype of type 'Map<String, dynamic>'
}
【问题讨论】:
标签: firebase flutter dart google-cloud-firestore flutter-dependencies