call method

Future<List<T?>?> call([
  1. List<T>? dataList
])

Implementation

Future<List<T?>?> call([List<T>? dataList]) async {
  if (_lastResponse != null &&
      !_lastResponse!.isExpired(_cacheTimeout.inMilliseconds)) {
    var same = _lastResponse!.isSameCall(operation, parameters, dataList);
    if (same) {
      return deepCopy<List<T?>>(_lastResponse!.result as List<T?>?);
    }
  }

  var dataSource = this.dataSource;
  dataSource ??= await dataSourceAsync;

  var result = await dataSource.doOperation(operation, parameters, dataList);
  _lastResponse = DataSourceResponse(operation, parameters, dataList, result);
  return result;
}