featureFlagValueProvider top-level property
final
A convenience provider to retrieve the value of a specific feature flag by its key.
Throws an ArgumentError if the key is not found in the loaded flags.
Implementation
final featureFlagValueProvider = FutureProvider.family<dynamic, String>((
ref,
key,
) async {
final flags = await ref.watch(featureFlagsProvider.future);
final flag = flags.firstWhere(
(f) => f.key == key,
orElse: () => throw ArgumentError('Flag $key not found'),
);
return flag.value;
});