PrfEncoded<TSource, TStore>  constructor 
      
      PrfEncoded<TSource, TStore> (})
     
    
Creates a new PrfEncoded variable with the specified encoding and decoding functions.
Parameters:
- key: Unique identifier for the variable in SharedPreferences
- from: Function to decode from storage type- TStoreto source type- TSource
- to: Function to encode from source type- TSourceto storage type- TStore
- getter: Function to retrieve the encoded value from SharedPreferences
- setter: Function to save the encoded value to SharedPreferences
- defaultValue: Optional default value to use when no value is stored
Implementation
PrfEncoded(
  String key, {
  required Decode<TSource, TStore> from,
  required Encode<TSource, TStore> to,
  required Future<TStore?> Function(SharedPreferences prefs, String key)
      getter,
  required Future<bool> Function(
    SharedPreferences prefs,
    String key,
    TStore value,
  ) setter,
  TSource? defaultValue,
}) : super(
        key,
        (prefs, key) async {
          final stored = await getter(prefs, key);
          return from(stored);
        },
        (prefs, key, value) async {
          final stored = to(value);
          return setter(prefs, key, stored);
        },
        defaultValue,
      );