Gson is an open-source JSON library which aims to be simple and quick to use while providing a bunch of options to accommodate even some complex use cases.

In this tutorial you’re going to learn how to serialize and parse interfaces to JSON strings. An interface cannot be instantiated so we need to somehow remember the the class which implements our interface and instantiate this class directly. GSON lets us do it in an elegant and simple way.

This post contains all the code that’s been written in this YouTube video.

 

To get the code check out this GitHub repository: https://github.com/ResoCoder/gson-tutorial-interfaces

 

About the author 

Matt Rešetár

Matt is an app developer with a knack for teaching others. Working as a freelancer and most importantly developer educator, he is set on helping other people succeed in their Flutter app development career.

You may also like

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
    >