DEV Community


Flutter SQLite example - CRUD Operations with ListView & sqflite plugin

loizenai profile image loizenai ・2 min read

Flutter SQLite example - CRUD Operations with ListView & sqflite plugin

In previous post, we knew how to make SQLite CRUD Operations using sqflite plugin. In this tutorial, we're gonna build a Flutter App that allows us to make CRUD interactions with SQLite in a ListView.

Related Post:


Example Overview


Our Flutter App will retrieve list of Notes from SQLite Database and show it in ListView widget. Then we can click on Add button to create new Note, click on a Note item to update that Note, or delete a Note with remove Button.


Project Structure


  • Note class (note.dart) is a Data Model.
  • DatabaseHelper class (database_helper.dart) handles CRUD Operations with SQLite using sqflite plugin.
  • ListViewNote (listview_note.dart) is a StatefulWidget with List<Note> is state variable. It shows the list using ListView.builder, sends/gets data to/from NoteScreen using Navigator.
  • NoteScreen (note_screen.dart) is the user interface for adding/updating Note.
  • We add sqflite dependency in pubspec.yaml.

For more detailsa about ListView and Navigator, please visit:


Discussion (0)

Editor guide