getQuestions method

Stream<JotformQuestion> getQuestions(
  1. String form
)

Implementation

Stream<JotformQuestion> getQuestions(String form) async* {
  Map<String, dynamic> g = await http
      .get(getUrl("form/$form/questions", params: {}))
      .then((value) {
    Map<String, dynamic> body = jsonDecode(value.body);
    if (body["limit-left"] is int) {
      limitLeft = body["limit-left"];
    }

    return body["content"] as Map<String, dynamic>;
  });

  for (dynamic i in g.values) {
    yield JotformQuestionMapper.fromMap(i);
  }
}