vault<T> method

Future<Vault<T>> vault<T>({
  1. VaultManager? manager,
  2. String? name,
  3. dynamic fromEncodable(
    1. Map<String, dynamic>
    )?,
  4. VaultLoader<T>? vaultLoader,
  5. EventListenerMode? eventListenerMode,
  6. bool? statsEnabled,
  7. VaultStats? stats,
})

Creates a new Vault backed by a Store

  • manager: An optional VaultManager
  • name: The name of the vault
  • fromEncodable: The function that converts between the Map representation of the object and the object itself.
  • vaultLoader: The VaultLoader that should be used to fetch a new value upon absence
  • eventListenerMode: The event listener mode of this cache
  • statsEnabled: If statistics should be collected, defaults to false
  • stats: The statistics instance

Returns a Vault backed by a Store

Implementation

Future<Vault<T>> vault<T>(
    {VaultManager? manager,
    String? name,
    dynamic Function(Map<String, dynamic>)? fromEncodable,
    VaultLoader<T>? vaultLoader,
    EventListenerMode? eventListenerMode,
    bool? statsEnabled,
    VaultStats? stats}) {
  return _newGenericVault<T>(this,
      manager: manager,
      name: name,
      fromEncodable: fromEncodable,
      vaultLoader: vaultLoader,
      eventListenerMode: eventListenerMode,
      statsEnabled: statsEnabled,
      stats: stats);
}