Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mysCod3r committed Aug 31, 2024
1 parent 1de46e7 commit cc9932e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ INetworkManager networkManager = NetworkManage<Null or UserErrorModel>(isEnable

### `sendRequest`

This method is designed to improve the 'send' method. The response is a 'NetworkResult' object, which is a `sealed class`. You can use it however you like, either with pattern matching or other methods.

```dart
final response = await networkManager.sendRequest<Todo, List<Todo>>(
'/todos',
Expand Down Expand Up @@ -84,7 +86,7 @@ INetworkManager networkManager = NetworkManage<Null or UserErrorModel>(isEnable
// handle success case
return;
}
if (response.isError) {
final error = (response as NetworkErrorResult<List<Todo>,EmptyModel>).error;
// handle error case
Expand Down

0 comments on commit cc9932e

Please sign in to comment.