Skip to content

Commit 141cf5f

Browse files
committed
Add explanatory comments to MapNotifier in optimistic update examples
- Add comment explaining widgets watching MapNotifier will automatically rebuild - Applied to all three examples using MapNotifier: - optimistic_simple_delete_example.dart - optimistic_undoable_delete_example.dart - optimistic_undoable_toggle_example.dart - Clarifies reactive nature of MapNotifier for readers
1 parent 0dd66bf commit 141cf5f

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎code_samples/lib/command_it/optimistic_simple_delete_example.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import '_shared/stubs.dart';
44

55
// #region example
66
class TodoManager {
7+
// MapNotifier is a reactive map - widgets watching it will automatically rebuild on any data change
78
final todos = MapNotifier<String, Todo>();
89

910
late final deleteCommand = Command.createAsyncNoResult<Todo>(

‎code_samples/lib/command_it/optimistic_undoable_delete_example.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import '_shared/stubs.dart';
44

55
// #region example
66
class TodoManager {
7+
// MapNotifier is a reactive map - widgets watching it will automatically rebuild on any data change
78
final todos = MapNotifier<String, Todo>();
89

910
late final deleteTodoCommand = Command.createUndoableNoResult<Todo, Todo>(

‎code_samples/lib/command_it/optimistic_undoable_toggle_example.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import '_shared/stubs.dart';
44

55
// #region example
66
class TodoManager {
7+
// MapNotifier is a reactive map - widgets watching it will automatically rebuild on any data change
78
final todos = MapNotifier<String, Todo>();
89

910
late final toggleCompleteCommand =

0 commit comments

Comments
 (0)