newGenericVault<V, T extends Store<VaultInfo, VaultEntry> > function
Creates a Vault
bound to an implementation of the Store
interface
store
: The store implementationname
: The name of the vaultfromEncodable
: The function that converts between the Map representation of the object and the object itself.vaultLoader
: TheVaultLoader
, that should be used to fetch a new value upon absenceclock
: The source of time to be usedeventListenerMode
: The event listener mode of this vaultstatsEnabled
: If statistics should be collected, defaults to falsestats
: The statistics instance
Implementation
Future<Vault<V>> newGenericVault<V, T extends Store<VaultInfo, VaultEntry>>(
T store,
{String? name,
dynamic Function(Map<String, dynamic>)? fromEncodable,
VaultLoader<V>? vaultLoader,
Clock? clock,
EventListenerMode? eventListenerMode,
bool? statsEnabled,
VaultStats? stats}) {
return DefaultVaultManager().newGenericVault(store,
name: name,
fromEncodable: fromEncodable,
vaultLoader: vaultLoader,
clock: clock,
eventListenerMode: eventListenerMode,
statsEnabled: statsEnabled,
stats: stats);
}