findAll method

Future<List<T>?> findAll(
  1. {bool? remote,
  2. bool? background,
  3. Map<String, dynamic>? params,
  4. Map<String, String>? headers,
  5. bool? syncLocal,
  6. OnSuccessAll<T>? onSuccess,
  7. OnErrorAll<T>? onError,
  8. DataRequestLabel? label}

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.


Future<List<T>?> findAll({
  bool? remote,
  bool? background,
  Map<String, dynamic>? params,
  Map<String, String>? headers,
  bool? syncLocal,
  OnSuccessAll<T>? onSuccess,
  OnErrorAll<T>? onError,
  DataRequestLabel? label,
}) {
  return remoteAdapter.findAll(
    remote: remote,
    background: background,
    params: params,
    headers: headers,
    syncLocal: syncLocal,
    onSuccess: onSuccess,
    onError: onError,
    label: label,