newVault<V> method
Creates a new vault
store
: TheStore
name
: 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 used on thiseventListenerMode
: The event listener mode of this cachestatsEnabled
: If statistics should be collected, defaults to falsestats
: The statistics instance
Implementation
Future<Vault<V>> newVault<V>(T store,
{String? name,
dynamic Function(Map<String, dynamic>)? fromEncodable,
VaultLoader<V>? vaultLoader,
Clock? clock,
EventListenerMode? eventListenerMode,
bool? statsEnabled,
VaultStats? stats}) {
return newGenericVault<V, T>(store,
name: name,
fromEncodable: fromEncodable ?? generator.fromEncodable,
vaultLoader: vaultLoader,
clock: clock,
eventListenerMode: eventListenerMode,
statsEnabled: statsEnabled,
stats: stats);
}