vault<T> method
Future<Vault<T> >
vault<T>({
- VaultManager? manager,
- String? name,
- dynamic fromEncodable()?,
- VaultLoader<
T> ? vaultLoader, - EventListenerMode? eventListenerMode,
- bool? statsEnabled,
- VaultStats? stats,
Creates a new Vault backed by a Store
manager
: An optional VaultManagername
: The name of the vaultfromEncodable
: 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 absenceeventListenerMode
: The event listener mode of this cachestatsEnabled
: If statistics should be collected, defaults to falsestats
: The statistics instance
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);
}