findAll method
- {bool? remote,
- bool? background,
- Map<
String, dynamic> ? params, - Map<
String, String> ? headers, - bool? syncLocal,
- OnSuccessAll<
T> ? onSuccess, - OnErrorAll<
T> ? onError, - 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
.
Implementation
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,
);
}