feature_flage_amplitude 0.0.1 copy "feature_flage_amplitude: ^0.0.1" to clipboard
feature_flage_amplitude: ^0.0.1 copied to clipboard

a feature flage for Amplitude

Usage #

(first) at your main() Method initialize your Experiment with your apiKey & experimentApp_name try { await Experiment.initializeWithAmplitude( apiKey: "$experimentApiKey", config: ExperimentConfig( debug: false, automaticExposureTracking: true, instanceName: "$experimentApp_name", ), ); } catch (e) {}

(second) get feature flage from these methods

ExperimentClient? _experiment; @override void initState() { _experiment = ExperimentClient(apiKey: AppValues.experimentApiKey); getFeatureFlage() }

void getFeatureFlage() { try { featureFlag().then((varient) async { if (varient?.value == "on") { //here take you action at case on } else { //here take you action at case off } }); } catch (e) {} }

Future<ExperimentVariant?> featureFlag() async { ExperimentVariant? variant;

try {
  await _experiment?.fetch(userId: "userId").then((_) {
    variant = _experiment?.variant(AppValues.mazadFeatureFlage);
  });
} catch (e) {
  variant = null;
}
return variant;

}

1
likes
120
points
30
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

a feature flage for Amplitude

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

flutter, http, shared_preferences

More

Packages that depend on feature_flage_amplitude