getNextDatapoint<ChildData extends Data, ParentData extends WithOffline?> method

Future<List<ChildData>> getNextDatapoint<ChildData extends Data, ParentData extends WithOffline?>(
  1. ParentData data
)

gets all the ChildDatapoints for the given ParentData if no ParentData is given it defaults to root

Implementation

Future<List<ChildData>>
    getNextDatapoint<ChildData extends Data, ParentData extends WithOffline?>(
  ParentData data,
) async {
  final childTypeStr = Helper.getIdentifierFromData<ChildData>(null);
  if (childTypeStr == null) throw Exception('type not supported');
  return (await _getAllForNextLevel<ChildData, ParentData>(
        json: data?.toSmallJson(),
        id: data?.id,
      )) ??
      [];
}