initialize method

  1. @mustCallSuper
FutureOr<Repository<T>> initialize({
  1. bool? remote,
  2. bool? verbose,
  3. required Map<String, RemoteAdapter<DataModel>> adapters,
})

Initializes this Repository. Nothing will work without this. In standard scenarios this initialization is done by the framework.

Implementation

@mustCallSuper
FutureOr<Repository<T>> initialize(
    {bool? remote,
    bool? verbose,
    required Map<String, RemoteAdapter> adapters}) async {
  if (isInitialized) return this;
  _adapters.addAll(adapters);
  await remoteAdapter.initialize(
    remote: remote,
    verbose: verbose,
    adapters: adapters,
    ref: _ref,
  );
  _isInit = true;
  return this;
}