Coding the happy path with Commands and Exceptions
summary
A Flutter app called Watch Crunch uses Thomas Burkhart’s packages (get_it, fl_command, watch_it) to move error, busy and result handling out of widgets: a Command wraps async work, exposes errors ValueListenable, isExecuting and a canExecute restrictions input, catches exceptions to a global handler with pluggable filters, and prevents double execution. Implementations include a paged FeedDataSource, a global post repository with change‑notifier proxies, optimistic updates with an undoable command and executeWithFuture for pull‑to‑refresh — all running in production.
AI-written summary · about
chapters (14)
- 0:00Introduction and motivation
- 2:10Happy path vs error handling
- 4:17What are Flutter Commands
- 8:54Command features and use cases
- 11:10Error handling with Commands
- 13:36Real-world error filter example
- 16:50UI integration with WatchIt
- 19:47Paginated feed data sources
- 26:10Mutable data and change notifiers
- 28:17Post proxy and repository pattern
- 31:30User proxy and data abstraction
- 34:44Optimistic UI updates
- 36:33Undoable Commands
- 38:41Conclusion and resources
related talks
39mCoding with dinosaurs
44mUnconditional Code
51mTechniques for Wielding Data and Behaviors
36mBuilding Strong Code Through Patterns
40mLessons from two decades of writing bad code
33mThe Catcher in the Code
02h 42mClean Code: The Next Chapter
40mCode Writing Code, say what now! Meta Programming and PowerShell
