Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GIfatahTH committed Jan 13, 2020
1 parent 8e487cb commit 9b4b331
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions states_rebuilder/lib/ui/pages/home_screen/todo_list.dart
Expand Up @@ -15,6 +15,7 @@ class TodoList extends StatelessWidget {
final todosServiceRM = Injector.getAsReactive<TodosService>();
@override
Widget build(BuildContext context) {
//use whenConnectionState method to go through all the possible status of the ReactiveModel
return todosServiceRM.whenConnectionState(
onIdle: () => Container(),
onWaiting: () => Center(
Expand All @@ -33,6 +34,7 @@ class TodoList extends StatelessWidget {
);
},
onError: (error) {
//Delegate error handling to the static method ErrorHandler.getErrorMessage
return Center(child: Text(ErrorHandler.getErrorMessage(error)));
},
);
Expand Down

0 comments on commit 9b4b331

Please sign in to comment.