ExperimentAdapter class abstract
Provides the backing values for experiments and serves as a registry for experiments.
An adapter must be initialized before it can be used by calling init.
Constructors
Properties
-
experiments
→ List<
AdaptedExperiment> -
The experiments that are registered with this adapter.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add<
T> (AdaptedExperiment< T> experiment) → Experiment<T> -
boolean(
{required String id, bool defaultVariant = false, Map< bool, int> ? weightedVariants, double sampleSize = 1, bool enabled = true}) → Experiment<bool> - Registers and returns a new boolean experiment.
-
enumerated<
T extends Enum> ({required String id, required T defaultVariant, List< T> ? variants, Map<T, int> ? weightedVariants, double sampleSize = 1, bool enabled = true}) → Experiment<T> - Registers and returns a new Enum based experiment.
-
get<
T> (String id) → T? -
Returns the value for the experiment with the given
id
. -
has(
String id) → bool -
Returns whether this adapter has a value for the experiment with the given
id
. -
init(
ExperimentConfig config) → Future< void> - Initializes this adapter.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
numeric(
{required String id, int defaultVariant = 0, List< int> ? variants, Map<int, int> ? weightedVariants, double sampleSize = 1, bool enabled = true}) → Experiment<int> - Registers and returns a new numeric experiment.
-
text(
{required String id, String defaultVariant = '', List< String> ? variants, Map<String, int> ? weightedVariants, double sampleSize = 1, bool enabled = true}) → Experiment<String> - Registers and returns a new text experiment.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
ExperimentConfig config, {bool force = false}) → Future< void> - Updates the values for all experiments, if appropriate.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited