0 purchases
control config
Part of [flutter_control] family #
This library is wrapper around [shared_preferences]
Mixin provider:
class UserPrefs with PrefsProvider {
String get userId => prefs.get('user_id');
set userId(String value) => prefs.set('user_id', value);
}
copied to clipboard
Model:
final boolPref = PrefModel.boolean('visited');
final numPref = PrefModel.number('fav_num', defaultValue: -1);
void updateVisited() {
boolPref.value = numPref.value > 0;
}
copied to clipboard
Instance:
final id = PrefsProvider.instance.get('user_id');
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.