Update Blocs authored by Nicholas Sarian's avatar Nicholas Sarian
...@@ -23,4 +23,8 @@ After the bloc gets the requested information from the repositories, a new Creat ...@@ -23,4 +23,8 @@ After the bloc gets the requested information from the repositories, a new Creat
```dart ```dart
emit(CreatePlayerComplete(response)); emit(CreatePlayerComplete(response));
``` ```
In the example above, the CreatePlayerComplete state is emitted with the response from the repository. This state transition is later picked up by the page and it changes the page according to the response and what information the page request In the example above, the CreatePlayerComplete state is emitted with the response from the repository. This state transition is later picked up by the page and it changes the page according to the response and what information the page request
\ No newline at end of file
---
Within a bloc, there are typically three states that can be emitted: the initial state, the loading state, and the complete state. The initial state is emitted when the bloc is first created, typically when the user loads the page. The loading state is emitted when the page needs to retrieve information from the backend, and it indicates to the UI that the bloc is currently in the process of fetching the data. This state is often used to display a loading indicator to the user. The complete state is emitted when a response has been received from the backend. This state will typically include the response data, which the UI can use to update the page with the retrieved information.
\ No newline at end of file