PreferencesKeyValueServer constructor

PreferencesKeyValueServer(
  1. SharedPreferences _preferences,
  2. String name, {
  3. Set<ValueWithType> keySuggestions = const {},
  4. Set<ValueWithType> keyOptions = const {},
  5. Map<String, String> keyIcons = const {},
  6. Map<String, StorageType> typeForKey = const {},
  7. String? icon,
})

Implementation

PreferencesKeyValueServer(
  this._preferences,
  this.name, {
  this.keySuggestions = const {},
  this.keyOptions = const {},

  /// Icon hints to show for specific keys. See [iconForKey] for more information
  Map<String, String> keyIcons = const {},

  /// Hints indicating for which specific key, which type is expected
  Map<String, StorageType> typeForKey = const {},
  this.icon,
})  : typeForKey = typeForKey.map(
        (key, value) =>
            MapEntry(ValueWithType(StorageType.string, key), value),
      ),
      keyIcons = keyIcons.map(
        (key, value) =>
            MapEntry(ValueWithType(StorageType.string, key), value),
      );