I've read the previous questions posted related to this topic but couldn't understand whats going on. I think I've done exactly the same process explained in this official dart/flutter video - <https://www.youtube.com/watch?v=SmTCmDMi4BY>

What I'm trying to do is very simple. I want to make an API call and need to wait until I get a response. but I can't see to get it working. Maybe my understanding on async/wait is wrong. If I check the console output I get like this

```
Staring the Program
Ending the Program
Got the questions list
[Instance of 'Question', Instance of 'Question', Instance of 'Question', Instance of 'Question', Instance of 'Question', Instance of 'Question', Instance of 'Question', Instance of 'Question', Instance of 'Question', Instance of 'Question']

```

Can someone help me with this.

```
import 'package:http/http.dart' as http;
import 'dart:convert';

void main() {
  print('Staring the Program');
  getQuestions();
  print('Ending the Program');
}

void getQuestions() async {
  QuizModel qm = QuizModel();
  List<Question> questionsList = await qm.getQuestions();
  print('Got the questions list');
  print(questionsList);
}

class Question {
  String question;
  bool answer;
  Question({this.question, this.answer});
}

class QuizModel {
  var quizData;

  Future<List<Question>> getQuestions() async {
    NetworkHelper networkHelper =
        NetworkHelper('https://opentdb.com/api.php?amount=10&type=boolean');
    quizData = await networkHelper.getData();
    final List<Question> questionsList = [];
    for (final question in quizData['results']) {
      bool answer;
      question['correct_answer'] == 'True' ? answer = true : answer = false;
      questionsList
          .add(Question(question: question['question'], answer: answer));
    }
    return questionsList;
  }
}

class NetworkHelper {
  final String _url;
  NetworkHelper(this._url);

  Future<dynamic> getData() async {
    http.Response response = await http.get(_url);

    if (response.statusCode == 200) {
      var jsonData = jsonDecode(response.body);
      return jsonData;
    } else {
      print(response.statusCode);
    }
  }
}

```