ab_testing_core 1.0.0 copy "ab_testing_core: ^1.0.0" to clipboard
ab_testing_core: ^1.0.0 copied to clipboard

A/B testing for user experience research through randomized experiments that involve two or more variants.

AbTesting

AB Testing - Core #

A Dart package that helps to implement multiple a/b tests.

Features #

This package simplifies the creation and management of multiple a/b tests. It comes with a local adapter for local a/b tests and can be extended with further adapters. It supports test values of the types bool, int, String and Enum.

The package ab_testing_firebase provides an additional firebase adapter that simplifies remote a/b tests.

Getting started #

You need to add ab_testing_core to the dependencies of the pubspec.yaml.

dependencies:
ab_testing_core: ^1.0.0

Usage #

You can create your own configuration that extends the ExperimentConfig class with all the adapters and experiments you need. Directly during initialisation, you can select which adapter should be used for the respective experiment.

class LocalExperimentConfig extends ExperimentConfig {
  final Experiment<bool> booleanExperiment;
  final Experiment<int> numericExperiment;
  final Experiment<String> textExperiment;
  final Experiment<ExampleEnum> enumeratedExperiment;

  LocalExperimentConfig(ExperimentAdapter localExperiments)
      : booleanExperiment = localExperiments.boolean(id: 'boolExperiment'),
        numericExperiment = localExperiments.numeric(id: 'intExperiment'),
        textExperiment = localExperiments.text(id: 'textExperiment'),
        enumeratedExperiment = localExperiments.enumerated(
          id: 'enumExperiment',
          defaultVariant: ExampleEnum.control,
          weightedVariants: {ExampleEnum.control: 1, ExampleEnum.test: 1},
        ),
        super([localExperiments]);
}

After initialisation, you can pass your ExperimentAdapters to your ExperimentConfig.

final _localExperiments = LocalExperimentAdapter(_storage.userSeed);
final _experimentConfig = LocalExperimentConfig(_localExperiments);

Afterwards, you can easily access the experiments in your app via your Config.

bool get boolean => _experimentConfig.booleanExperiment.value;
int get numeric => _experimentConfig.numericExperiment.value;
String get text => _experimentConfig.textExperiment.value;
ExampleEnum get enumerated => _experimentConfig.enumeratedExperiment.value;
7
likes
120
pub points
24%
popularity

Publisher

verified publisherprogrammier.bar

A/B testing for user experience research through randomized experiments that involve two or more variants.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on ab_testing_core