This is a companion discussion topic for the original entry at https://www.raywenderlich.com/18177023-your-second-flutter-app/lessons/6
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/18177023-your-second-flutter-app/lessons/6
I’m facing an issue while I run the app:
Exception has occurred.
SocketException (SocketException: Failed host lookup: ‘api.raywenderlich.com’ (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.
apiResponse["data"]
.map((json) => courses.add(Course.fromJson(json)))
.toList();