findOne method
Returns model of type T
by id
.
If _RemoteAdapter.shouldLoadRemoteOne
(function of remote
) is true
,
it will initiate an HTTP call.
Otherwise returns model of type T
and id
in local storage.
Arguments params
and headers
will be merged with
_RemoteAdapter.defaultParams
and _RemoteAdapter.defaultHeaders
, respectively.
See also: _RemoteAdapter.urlForFindOne
, _RemoteAdapter.methodForFindOne
.
Implementation
Future<T?> findOne(
final dynamic id, {
bool? remote,
Map<String, dynamic>? params,
Map<String, String>? headers,
OnDataError<T>? onError,
}) {
return remoteAdapter.findOne(
id,
remote: remote,
params: params,
headers: headers,
onError: onError,
);
}