Loading topic
Intermediate · Mid: 17 chapters · 28 min read. States assumed prerequisites
Start readingasync and await, and recognize basic database terms such as table and row. You do not need to write SQL yet. The goal here is to install drift and confirm that its code-generation tool is available.async and await, and understand that a relational database stores data in tables and rows. You should also know how to run Flutter and Dart commands.drift_flutter are already familiar. The goal is to connect your Dart schema to the generated Dart code that drift uses at runtime.async and await, Flutter project commands, and the purpose of a relational database table. It also assumes that your tables are already defined and that drift code generation is configured. The generated file does not exist until you run `build_rasync and await, Futures, Streams, and relational database terms such as tables and rows.Future and Stream, and have already created the AppDatabase and TodoItems table from the previous chapters. The examples below go inside AppDatabase.async and await, Drift table definitions, and the difference between a Future and a Stream. It also assumes that AppDatabase and the generated TodoItem and TodoItems classes already exist.async and await, Flutter widgets, and StreamBuilder. It also assumes that AppDatabase and the TodoItems table from earlier chapters already exist.async and await, Flutter widgets, and the StreamBuilder widget. It also assumes that AppDatabase and TodoItem were defined in the previous chapters.async and await, and drift table definitions. You should also know how to insert rows with into(table).insert(...).async and await, and drift table definitions. This chapter also assumes an existing AppDatabase with a TodoItems table and a generated database.g.dart file.Future, Stream, and the basic ideas of tables, rows, and primary keys. This chapter uses a TodoItems table and a Categories table. Each to-do can have one category, but a category is optional.async and await, Drift tables, generated row types, and basic CRUD queries. It focuses on data access objects, or DAOs.async and await, and that your AppDatabase class already contains generated drift code. It also assumes that your constructor accepts an optional QueryExecutor, as in the earlier chapters.Future, Stream, and the AppDatabase class from earlier chapters. The goal is to keep SQLite work from blocking Flutter’s main isolate, which is responsible for drawing frames and responding to input.