findAll method

Future<List<T>> findAll({
  1. bool? remote,
  2. Map<String, dynamic>? params,
  3. Map<String, String>? headers,
  4. bool? syncLocal,
  5. OnDataError<List<T>>? onError,
})

Returns all models of type T.

If _RemoteAdapter.shouldLoadRemoteAll (function of remote) is true, it will initiate an HTTP call. Otherwise returns all models of type T in local storage.

Arguments params and headers will be merged with _RemoteAdapter.defaultParams and _RemoteAdapter.defaultHeaders, respectively.

For local storage of type T to be synchronized to the exact resources returned from the remote source when using findAll, pass syncLocal: true. This call would, for example, reflect server-side resource deletions. The default is syncLocal: false.

See also: _RemoteAdapter.urlForFindAll, _RemoteAdapter.methodForFindAll.

Implementation

Future<List<T>> findAll({
  bool? remote,
  Map<String, dynamic>? params,
  Map<String, String>? headers,
  bool? syncLocal,
  OnDataError<List<T>>? onError,
}) {
  return remoteAdapter.findAll(
    remote: remote,
    params: params,
    headers: headers,
    syncLocal: syncLocal,
    onError: onError,
  );
}