Chapter 58 — Task List
Part 1C — Eight Mini-Projects · Chapter 58 of 62 · 12 hours
Chapter 58 — Task List
Level: intermediate Estimated time: 12 hours Prerequisites: PART 1A (chapters 01 to 18), PART 1B (chapters 43 to 54), and projects 55, 56, 57 What you will be able to do by the end: build a complete task management app from start to finish — a serializable data model, a swappable repository, a filterable, sortable, searchable list, a validated form, undoable deletion, centralized state with
provider, on-disk persistence, and automated tests.
58.0 — Chapter Objectives
By the end of this chapter, you will be able to:
- model a task with a Dart class that has a priority
enum, aDateTimedue date, and tags; - write
fromJsonandtoJsonon this model (a recap of chapter 17); - write a correct
copyWithmethod, including for a nullable field; - define a repository interface (
repository) and provide three implementations of it; - display a collection with
ListView.builder(a recap of chapter 48); - handle a screen's empty state with care;
- check off a task and strike through its title with
TextDecoration.lineThrough; - add a task through a
showDialogdialog (a recap of chapter 49); - build a complete form with
Form,TextFormField, andvalidator; - reuse the same form for both creation and editing;
- delete by swiping with
Dismissibleand understand why theKeyis mandatory; - offer an undo for deletion with a
SnackBarand itsSnackBarAction; - filter a list with
where(a recap of chapter 14); - sort by due date or by priority, handling null values cleanly;
- wire a search bar to the list;
- display counters and a progress
LinearProgressIndicator; - pick a date with
showDatePicker; - format a date in French with the
intlpackage; - highlight overdue tasks;
- extract all the state into a
ChangeNotifierexposed byprovider(a recap of chapter 52); - persist tasks with
shared_preferences(a recap of chapter 54); - write the same persistence with
sqfliteand compare the two; - add a switchable, persisted dark mode;
- write unit tests for the filtering and sorting logic.
Comments
Comments are powered by GitHub Discussions
Sign in with GitHub to join the discussion