You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd love to be able to conveniently retrieve the defaults provided during initialization so i can "reset to defaults" in my app.
However, it would appear these defaults aren't saved anywhere within the PrefServiceShared. At first glance i thought no problem, i can just extend PrefServiceShared, cache my defaults add a getter then i realized PrefServiceShared is closed for extension. :(
for context:
final service = await PrefServiceShared.init(
defaults: {
'pref_a': 0,
'pref_b': 0,
'pref_c': 5000,
'pref_d': 500,
'pref_e': 4500,
},
);
...
// meanwhile.. in some code far far away..
...
PrefService.of(context).resetToDefaults(); // <<--- new function
// AND/OR
PrefService.of(context).resetToDefault('pref_d'); // <<---- another new function.
...
The text was updated successfully, but these errors were encountered:
I'd love to be able to conveniently retrieve the defaults provided during initialization so i can "reset to defaults" in my app.
However, it would appear these defaults aren't saved anywhere within the
PrefServiceShared
. At first glance i thought no problem, i can just extendPrefServiceShared
, cache my defaults add a getter then i realizedPrefServiceShared
is closed for extension. :(for context:
The text was updated successfully, but these errors were encountered: