fetchData method

Future<void> fetchData()

Implementation

Future<void> fetchData() async {
  try {
    pageKey += 1;
    List<T> list = await futureFunction(pageKey);
    print("end fetchData");
    if (list.isEmpty || list.length < 10) {
      isCompleted = true;
    }
    subject.sink.add(list);
  } catch (error) {
    errorHappen = true;
  }
}