I am new in flutter I want to show the itemcount data from Streambuilder listview builder to the dashboard of another widget. Please help
My file inside listview.dart is:
Flexible(
child: StreamBuilder(
stream: DatabaseManager.orderStream(isAscending),
builder: (context, AsyncSnapshot<QuerySnapshot> snapshot) {
final value = snapshot.data!.docs;
return value.isEmpty
? const Center(
child: Text(AppString.noAvailableOrder),
)
: ListView.builder(
itemCount: value.length,
itemBuilder: (context, i) => OrderListData(
id: value[i].id,
location: value[i]["recLocation"],
phoneNo: value[i]["recPhone"],
recName: value[i]["recName"],
),
);
},
),
),
],
),
);
}
},
);
}
I want to show item count data in dashboard.dart :