xStreambuilder method
Implementation
StreamBuilder xStreambuilder(
Widget Function(BuildContext, List<XDataModel>?) builder) {
return StreamBuilder(
stream: database().snapshots(),
builder: (context, AsyncSnapshot snapshot) {
List? data = snapshot.hasData ? snapshot.data.docs : null;
List<XData>? dataSet;
if (data != null) {
dataSet = data.map((e) => utils.document(e, fields)).toList();
} else {
dataSet = null;
}
return builder(context, dataSet);
},
);
}