Creating the place model and helper classes

In order to save the user's favorite places, we will use an SQLite database. As we did for the project in Chapter 6, Store That Data - Using Sq(F)Lite to Store Data in a Local Database, we'll use a model to insert the places to the database. So, let's begin, as follows:

  1. Create a new file in our project, called place.dart. Inside the file, we'll create a class, called Place, which will contain five properties:
    • The id integer.
    • The name String.
    • Two doubles for the latitude and longitude.
    • A String that will later contain an image.

The properties under Place will look like the following:

class Place {  int id;  String name;  double lat;  double lon;  String image;}
  1. Next, let's create a constructor ...

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.