new: add several values for dns and url test in auto complete mode
This commit is contained in:
@@ -96,35 +96,30 @@ class PreferencesNotifier<T, P> extends StateNotifier<T> {
|
||||
required Ref ref,
|
||||
required this.entry,
|
||||
this.overrideValue,
|
||||
this.possibleValues,
|
||||
}) : _ref = ref,
|
||||
super(overrideValue ?? entry.read());
|
||||
|
||||
final Ref _ref;
|
||||
final PreferencesEntry<T, P> entry;
|
||||
final T? overrideValue;
|
||||
final List<T>? possibleValues;
|
||||
|
||||
static StateNotifierProvider<PreferencesNotifier<T, P>, T> create<T, P>(
|
||||
String key,
|
||||
T defaultValue, {
|
||||
T Function(Ref ref)? defaultValueFunction,
|
||||
T Function(P value)? mapFrom,
|
||||
P Function(T value)? mapTo,
|
||||
bool Function(T value)? validator,
|
||||
T? overrideValue,
|
||||
}) =>
|
||||
static StateNotifierProvider<PreferencesNotifier<T, P>, T> create<T, P>(String key, T defaultValue,
|
||||
{T Function(Ref ref)? defaultValueFunction, T Function(P value)? mapFrom, P Function(T value)? mapTo, bool Function(T value)? validator, T? overrideValue, List<T>? possibleValues}) =>
|
||||
StateNotifierProvider(
|
||||
(ref) => PreferencesNotifier._(
|
||||
ref: ref,
|
||||
entry: PreferencesEntry<T, P>(
|
||||
preferences: ref.read(sharedPreferencesProvider).requireValue,
|
||||
key: key,
|
||||
defaultValue: defaultValueFunction?.call(ref) ?? defaultValue,
|
||||
mapFrom: mapFrom,
|
||||
mapTo: mapTo,
|
||||
validator: validator,
|
||||
),
|
||||
overrideValue: overrideValue,
|
||||
),
|
||||
ref: ref,
|
||||
entry: PreferencesEntry<T, P>(
|
||||
preferences: ref.read(sharedPreferencesProvider).requireValue,
|
||||
key: key,
|
||||
defaultValue: defaultValueFunction?.call(ref) ?? defaultValue,
|
||||
mapFrom: mapFrom,
|
||||
mapTo: mapTo,
|
||||
validator: validator,
|
||||
),
|
||||
overrideValue: overrideValue,
|
||||
possibleValues: possibleValues),
|
||||
);
|
||||
|
||||
static AutoDisposeStateNotifierProvider<PreferencesNotifier<T, P>, T> createAutoDispose<T, P>(
|
||||
|
||||
Reference in New Issue
Block a user