getDepot method

Future<Depot> getDepot(
  1. int depotId
)

Get a depot by id

This function sends a request to the API client to get a depot by id. If the request is successful, it returns the depot. In case of an error, the error is recorded in Crashlytics and the error is rethrown.

depotId The id of the depot to get.

Returns a Future<Depot> containing the depot.

Throws an error if the request fails for any reason.

Implementation

Future<Depot> getDepot(int depotId) =>
    _apiClient.getDepot(depotId).catchError((error) {
      _crashlytics?.recordError(error, StackTrace.current);
      throw error;
    });