This repository was archived by the owner on May 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
This repository was archived by the owner on May 7, 2023. It is now read-only.
Nested StreamBuilder not working #30
Copy link
Copy link
Open
Description
When I am using two streambuilder of SelectBloc one inside another. The inner stream builder is not working.
The inner stream builder is always returning text widget.
StreamBuilder<List<Map>>(
stream: filterBloc.items,
builder: (BuildContext context, AsyncSnapshot filterSnapshot) {
if(filterSnapshot.hasData) {
if(filterSnapshot.data.length==0) {
return Center(
child: Text('Downloading Data'),
);
}
Map<String, int> filterMap = Map<String, int>();
for(int i=0; i<filterSnapshot.data.length; i++)
filterMap[filterSnapshot.data[i]['name']] = filterSnapshot.data[i]['enabled'];
return StreamBuilder<List<Map>>(
stream: modelBloc.items,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if(snapshot.hasData) {
if(snapshot.data.length==0) {
return Center(
child: Text('Downloading Data'),
);
}
return ListView.builder(
shrinkWrap: true,
itemCount: snapshot.data.length,
itemBuilder: (context, index) {
Model item = Model().fromDb(snapshot.data[index]);
return ContestCard(size: size, item: item);
},
);
}
return Text('Loading');
},
);
}
return Container();
},
),
Metadata
Metadata
Assignees
Labels
No labels