LocalExperimentAdapter class

An ExperimentAdapter that uses AdaptedExperiment.sampleSize and AdaptedExperiment.weightedVariants to locally determine the value of an experiment.

Inheritance

Constructors

LocalExperimentAdapter({required FutureOr<int> resolveUserSeed()})

Properties

experiments List<AdaptedExperiment>
The experiments that are registered with this adapter.
final
hashCode int
The hash code for this object.
no setterinherited
resolveUserSeed FutureOr<int> Function()
Function that resolves a seed for the current user that will be used to deterministically select active experiments and experiment values.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add<T>(AdaptedExperiment<T> experiment) Experiment<T>
inherited
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.
inherited
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.
inherited
get<T>(String id) → T?
Returns the value for the experiment with the given id.
override
has(String id) bool
Returns whether this adapter has a value for the experiment with the given id.
override
init(ExperimentConfig config) Future<void>
Initializes this adapter.
override
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.
inherited
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.
inherited
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.
override

Operators

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