Loading topic
async and await, and Future. You should also know Flutter widgets such as StatelessWidget, StatefulWidget, and build. Familiarity with setState is useful because MVVM moves some responsibilities out of a widget.2 min readasync and await, Flutter widget composition, and familiarity with setState. The goal is to separate code that displays state from code that obtains and changes data.2 min readasync and await, Flutter widget build methods, and the limits of managing shared state with setState.2 min readasync and await, Flutter widget lifecycles, and how setState works. This chapter focuses on the state contract between a view model and its view.2 min readfinal variable can be assigned once, but an object stored in that variable may still be mutable.1 min readFuture, and basic Flutter widgets. This chapter focuses on the service layer. A service wraps one external data source, such as an HTTP API or local storage, behind a small Dart interface.1 min readasync/await, Future, and Flutter widget lifecycle. You should also be familiar with setState and why large widgets become difficult to maintain when they contain data-access code.2 min readasync and await, Flutter widget lifecycle methods, and setState. A view model is a class that prepares state for a view and performs actions requested by that view. It keeps business logic out of widget code.1 min readasync and await, Flutter widget lifecycle methods, and ChangeNotifier. It also assumes you have a view model with readable state and methods such as load() and toggle().2 min readasync/await, Future, and Flutter widget lifecycle methods. It also assumes you have used setState and understand why view state becomes harder to manage as a widget grows.2 min readasync/await, Flutter widget builds, and the earlier Todo, TodoRepository, and ChangeNotifier examples. The key idea is unidirectional data flow: the view sends user actions to the view model, and the view model sends updated state back to the vi2 min readFuture, async/await, Flutter widget lifecycles, and ChangeNotifier. This chapter focuses on dependency injection: giving a view model the repository it needs instead of creating that repository inside the view model.2 min readasync and await, Flutter’s ChangeNotifier, and the TodoListViewModel and TodoRepository types from earlier chapters. A unit test checks one class without building widgets. This makes view model tests fast and focused.1 min readasync and await, Flutter widget lifecycles, and the difference between setState and a ChangeNotifier. This chapter focuses on ownership: deciding who creates a view model and who must dispose of it.1 min readFuture, async/await, Flutter widgets, and ChangeNotifier. This chapter builds on a view model that already exposes state and uses a repository for data access.2 min readasync and await, Flutter widget lifecycles, and the basic roles of views, view models, and repositories.2 min read