Adding the Movie model class

In object-oriented languages, a common pattern when dealing with data, especially structured data, is creating classes that will serve as an interface between the data and the application. This is to make our code easier to both read and maintain, so we'll follow this pattern and create a Movie class that will contain the movie properties that we want to show to our user.

There are several pieces of data in the JSON file we received from the Movies API, but we'll just select a few of them: the ID, the title, the average votes, the release date, the overview (which is a description of the movie), and the poster path (this will contain the path of the image to show in our app, if one is available).

In the next few ...

Get Flutter Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.