save method

Future<void> save()

Store the current $ at key in shared preferences.

Implementation

Future<void> save() async {
  if (customSave == null) {
    assert(key != null);
    final toSave = serialize(_value);
    final pref = await SharedPreferences.getInstance();
    await pref.setString(key!, toSave);
  } else {
    await customSave!(_value);
  }
}