ab_testing_firebase

Creator: coderz1093

Last updated:

0 purchases

ab_testing_firebase Image
ab_testing_firebase Images
Add to Cart

Description:

ab testing firebase

AB Testing - Firebase #
A Dart package that simplifies the implementation of remote a/b tests with the Firebase Remote Config.
Features #
This package extends the ab_testing_core package with an additional firebase adapter and thus enables remote a/b tests with the Firebase Remote Config.
Getting started #
You need to add ab_testing_core and ab_testing_firebase to the dependencies of the pubspec.yaml.
dependencies:
ab_testing_core: ^1.0.0
ab_testing_firebase: ^1.0.0
copied to clipboard
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 ExampleExperimentConfig extends ExperimentConfig {
final Experiment<bool> localExperiment;
final Experiment<bool> remoteExperiment;

ExampleExperimentConfig(ExperimentAdapter localExperiments, ExperimentAdapter remoteExperiments)
: localExperiment = localExperiments.boolean(id: 'localExperiment'),
remoteExperiment = remoteExperiments.boolean(id: 'remoteExperiment'),
super([localExperiments, remoteExperiments]);
}
copied to clipboard
After initialisation, you can pass your ExperimentAdapters to your ExperimentConfig.
final _localExperiments = LocalExperimentAdapter(_storage.userSeed);
final _remoteExperiments = FirebaseExperimentAdapter();
final _experimentConfig = ExampleExperimentConfig(_localExperiments, _remoteExperiments);
copied to clipboard
Afterwards, you can easily access the experiments in your app via your Config.
bool get local => _experimentConfig.localExperiment.value;
bool get remote => _experimentConfig.remoteExperiment.value;
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.