The sqflite package provides classes and functions to
interact with a SQLite database.

The path package provides functions to
define the location for storing the database on disk.

dependencies

flutter

sdk

flutter

sqflite

path

Make sure to import the packages in the file you’ll be working in.

2. Define the Dog data model

Before creating the table to store information on Dogs, take a few moments to
define the data that needs to be stored. For this example, define a Dog class
that contains three pieces of data:
A unique id, the name, and the age of each dog.

3. Open the database

Before reading and writing data to the database, open a connection
to the database. This involves two steps: