FeatureFlagPlugin<TSettings, TContext> class abstract

The base class for a Feature Flag plugin. Feature Flags are useful to control the visibility of features in an application. They are setup on the server side and can be controlled by the server to enable/disable features for different users.

Inheritance

Constructors

FeatureFlagPlugin({required TSettings settings, required String name, required String title})

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings → TSettings
The settings for the feature flag plugin.
final
title String
finalinherited

Methods

dispose() Future<void>
inherited
getBool(String featureName, {bool defaultValue = false}) Future<bool>
Returns the value of the feature flag as a boolean.
getDouble(String featureName, {double defaultValue = 0.0}) Future<double>
Returns the value of the feature flag as a double.
getInt(String featureName, {int defaultValue = 0}) Future<int>
Returns the value of the feature flag as an integer.
getJson(String featureName, {Map<String, dynamic> defaultValue = const {}}) Future<Map<String, dynamic>>
Returns the value of the feature flag as a JSON object represented by a Map.
getString(String featureName, {String defaultValue = ''}) Future<String>
Returns the value of the feature flag as a string.
init() Future<void>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() Future<void>
Refreshes the feature flags. This is useful to force an update on the feature flag values.
setDefaults(Map<String, dynamic> defaults) Future<void>
Sets the default values for the feature flags. This is useful when the plugin is first initialized and want to set defaults before fetching the actual values.
toString() String
A string representation of this object.
inherited
updateContext(TContext context) Future<void>
Updates the context of the feature flag plugin. This could include setting the user id, user attributes, locale, etc.

Operators

operator ==(Object other) bool
The equality operator.
inherited