getDepots method

Future<List<Depot>> getDepots({
  1. String? clusterOrRegion,
})

Get all depots

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

Returns a Future<List<Depot>> containing a list of depots.

Throws an error if the request fails for any reason.

Implementation

Future<List<Depot>> getDepots({String? clusterOrRegion}) =>
    _apiClient.getDepots(clusterOrRegion).catchError((error) {
      _crashlytics?.recordError(error, StackTrace.current);
      throw error;
    });