How to parse JSON in Dart / Flutter

JSON is a cornerstone in most Android apps, but how do you parse JSON in Dart and Flutter?

As mentioned in my “4 tips to boost your software development career” post, I’ve been experimenting with Flutter recently. Dart, the language used by Flutter, comes with a good library to parse JSON (dart:convert) but after having used gson for years in my Android apps, I had to relearn how to parse JSON.

If you Google gson for Dart , you will also find a library called dson. However, for this code tutorial, I’m focusing on using dart:convert.

To follow the code tutorial, create a new app as follows.

If you’re unsure how to set up a Flutter app, check out Getting started with Flutter official tutorial.

Continue reading “How to parse JSON in Dart / Flutter”