0%
Task List — Chapter 58

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, a DateTime due date, and tags;
  • write fromJson and toJson on this model (a recap of chapter 17);
  • write a correct copyWith method, 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 showDialog dialog (a recap of chapter 49);
  • build a complete form with Form, TextFormField, and validator;
  • reuse the same form for both creation and editing;
  • delete by swiping with Dismissible and understand why the Key is mandatory;
  • offer an undo for deletion with a SnackBar and its SnackBarAction;
  • 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 intl package;
  • highlight overdue tasks;
  • extract all the state into a ChangeNotifier exposed by provider (a recap of chapter 52);
  • persist tasks with shared_preferences (a recap of chapter 54);
  • write the same persistence with sqflite and 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

Link copied!