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:
- 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;}
- Next, let's create a constructor ...