@@ -89,9 +89,10 @@ Cache<T> newTieredCache<T>(
89
89
extension VaultExtension on Store <VaultInfo , VaultEntry > {
90
90
/// Creates a new [Vault] backed by a [Store]
91
91
///
92
- /// * [manager] : An optional [VaultManager]
93
92
/// * [store] : An existing store
93
+ /// * [manager] : An optional [VaultManager]
94
94
/// * [name] : The name of the vault
95
+ /// * [fromEncodable] : The function that converts between the Map representation of the object and the object itself.
95
96
/// * [eventListenerMode] : The event listener mode of this cache
96
97
/// * [statsEnabled] : If statistics should be collected, defaults to false
97
98
/// * [stats] : The statistics instance
@@ -100,11 +101,13 @@ extension VaultExtension on Store<VaultInfo, VaultEntry> {
100
101
Future <Vault <T >> _newGenericVault <T >(Store <VaultInfo , VaultEntry > store,
101
102
{VaultManager ? manager,
102
103
String ? name,
104
+ dynamic Function (Map <String , dynamic >)? fromEncodable,
103
105
EventListenerMode ? eventListenerMode,
104
106
bool ? statsEnabled,
105
107
VaultStats ? stats}) {
106
108
return (manager ?? VaultManager .instance).newGenericVault <T >(store,
107
109
name: name,
110
+ fromEncodable: fromEncodable,
108
111
eventListenerMode: eventListenerMode,
109
112
statsEnabled: statsEnabled,
110
113
stats: stats);
@@ -114,6 +117,7 @@ extension VaultExtension on Store<VaultInfo, VaultEntry> {
114
117
///
115
118
/// * [manager] : An optional [VaultManager]
116
119
/// * [name] : The name of the vault
120
+ /// * [fromEncodable] : The function that converts between the Map representation of the object and the object itself.
117
121
/// * [eventListenerMode] : The event listener mode of this cache
118
122
/// * [statsEnabled] : If statistics should be collected, defaults to false
119
123
/// * [stats] : The statistics instance
@@ -122,12 +126,14 @@ extension VaultExtension on Store<VaultInfo, VaultEntry> {
122
126
Future <Vault <T >> vault <T >(
123
127
{VaultManager ? manager,
124
128
String ? name,
129
+ dynamic Function (Map <String , dynamic >)? fromEncodable,
125
130
EventListenerMode ? eventListenerMode,
126
131
bool ? statsEnabled,
127
132
VaultStats ? stats}) {
128
133
return _newGenericVault <T >(this ,
129
134
manager: manager,
130
135
name: name,
136
+ fromEncodable: fromEncodable,
131
137
eventListenerMode: eventListenerMode,
132
138
statsEnabled: statsEnabled,
133
139
stats: stats);
@@ -142,6 +148,7 @@ extension CacheExtension on Store<CacheInfo, CacheEntry> {
142
148
/// * [store] : An existing store
143
149
/// * [manager] : An optional [CacheManager]
144
150
/// * [name] : The name of the cache
151
+ /// * [fromEncodable] : The function that converts between the Map representation of the object and the object itself.
145
152
/// * [expiryPolicy] : The expiry policy to use
146
153
/// * [sampler] : The sampler to use upon eviction of a cache element
147
154
/// * [evictionPolicy] : The eviction policy to use
@@ -153,6 +160,7 @@ extension CacheExtension on Store<CacheInfo, CacheEntry> {
153
160
Future <Cache <T >> _newGenericCache <T >(Store <CacheInfo , CacheEntry > store,
154
161
{CacheManager ? manager,
155
162
String ? name,
163
+ dynamic Function (Map <String , dynamic >)? fromEncodable,
156
164
KeySampler ? sampler,
157
165
EvictionPolicy ? evictionPolicy,
158
166
int ? maxEntries,
@@ -163,6 +171,7 @@ extension CacheExtension on Store<CacheInfo, CacheEntry> {
163
171
CacheStats ? stats}) {
164
172
return (manager ?? CacheManager .instance).newGenericCache <T >(store,
165
173
name: name,
174
+ fromEncodable: fromEncodable,
166
175
expiryPolicy: expiryPolicy,
167
176
sampler: sampler,
168
177
evictionPolicy: evictionPolicy,
@@ -177,6 +186,7 @@ extension CacheExtension on Store<CacheInfo, CacheEntry> {
177
186
///
178
187
/// * [manager] : An optional [CacheManager]
179
188
/// * [name] : The name of the cache
189
+ /// * [fromEncodable] : The function that converts between the Map representation of the object and the object itself.
180
190
/// * [expiryPolicy] : The expiry policy to use
181
191
/// * [sampler] : The sampler to use upon eviction of a cache element
182
192
/// * [evictionPolicy] : The eviction policy to use
@@ -190,6 +200,7 @@ extension CacheExtension on Store<CacheInfo, CacheEntry> {
190
200
Future <Cache <T >> cache <T >(
191
201
{CacheManager ? manager,
192
202
String ? name,
203
+ dynamic Function (Map <String , dynamic >)? fromEncodable,
193
204
KeySampler ? sampler,
194
205
EvictionPolicy ? evictionPolicy,
195
206
int ? maxEntries,
@@ -201,6 +212,7 @@ extension CacheExtension on Store<CacheInfo, CacheEntry> {
201
212
return _newGenericCache <T >(this ,
202
213
manager: manager,
203
214
name: name,
215
+ fromEncodable: fromEncodable,
204
216
expiryPolicy: expiryPolicy,
205
217
sampler: sampler,
206
218
evictionPolicy: evictionPolicy,
0 commit comments