Parse the Network Response |

This is a companion discussion topic for the original entry at

I’m facing an issue while I run the app:

Exception has occurred.
SocketException (SocketException: Failed host lookup: ‘’ (OS Error: No address associated with hostname, errno = 7))

First i thought I did something wrong, but this occurs on the git courses code too.

In the lesson around 4:30, why do we need to call .toList() in the following code? I think apiResponse["data"] is a list, and calling apiResponse["data"].map() should return a list? Does .toList() changes something in the data type? Thanks for answering @macsimus.

    .map((json) => courses.add(Course.fromJson(json)))