streamData2 method

Widget streamData2({
  1. required dynamic snapshot,
  2. required Widget consumerFunc(
    1. List<Map<String, dynamic>> resultList
    ),
})

Implementation

Widget streamData2({
  required dynamic snapshot,
  required Widget Function(List<Map<String, dynamic>> resultList) consumerFunc,
}) {
  //print('streamData2()');
  return HycopFactory.dataBase!.streamData2(
    snapshot: snapshot,
    consumerFunc: (List<Map<String, dynamic>> resultList) {
      modelList.clear();
      for (Map<String, dynamic> ele in resultList) {
        AbsExModel model = newModel(ele['mid'] ?? '');
        model.fromMap(ele);
        if (model.isRemoved.value == true) {
          //print('${model.mid} is removed');
          continue;
        }
        modelList.add(model);
      }
      //notifyListeners();
      return consumerFunc(resultList);
    },
  );
}