onlyModifier property

bool onlyModifier
final

Indicates whether this class is the only manager of the given preferences. Default value is true

If set to true, static private variables will be created for each preference and the getter will just return them. This means that you won't have to care about unnecessary calls to shared preferences.

If set to false, you should create local variable each time to prevent constant calls to shared preferences. For more information: https://dart.dev/guides/language/effective-dart/design#do-use-getters-for-operations-that-conceptually-access-properties

If this is set to true:

  bool? _$notification;
  bool get notification => _$notification ?? _helper.getBool(_keys.notification, true);
  set notification(bool val) => _helper.setBool(_keys.notification, val, (_) => _$notification = val);
  bool toggleNotification() => _helper.toggleBool(_keys.notification, true, (val) => _$notification = val);

If set to false

  bool get notification => _helper.getBool(_keys.notification, true);
  set notification(bool val) => _helper.setBool(_keys.notification, val);
  bool toggleNotification() => _helper.toggleBool(_keys.notification, true); // this line

Implementation

final bool onlyModifier;