This example stores information in the documents directory.
You can find the path to the documents directory as follows:

2. Create a reference to the file location

Once you know where to store the file, create a reference to the
file’s full location. You can use the File
class from the dart:io library to achieve this.

3. Write data to the file

Now that you have a File to work with,
use it to read and write data.
First, write some data to the file.
The counter is an integer, but is written to the
file as a string using the '$counter' syntax.

4. Read data from the file

Now that you have some data on disk, you can read it.
Once again, use the File class.

Complete example

Persist data with SQLite

Store key-value data on disk