flag_feature

Last updated:

0 purchases

flag_feature Image
flag_feature Images
Add to Cart

Description:

flag feature

Flag Feature #
Originally a fork of fire_flag with continued development and updates.
App wide feature flag manager. Manages the availability status of each features on the app utilizing the power of Firebase Remote Config.
Installing #
Add Flag Feature to your pubspec.yaml file:
dependencies:
flag_feature: ^2.0.1
copied to clipboard
Usage #
Adding Firebase configuration file #
Add the required GoogleServiceInfo.plist (for iOS) and google_services.json (for Android) respectively to your project. See here for further read about adding Firebase configuration file.
Firebase Remote Config Android integration #
Enable the Google services by configuring the Gradle scripts as such.

Add the classpath to the [project]/android/build.gradle file.

dependencies {
// Example existing classpath
classpath 'com.android.tools.build:gradle:3.2.1'
// Add the google services classpath
classpath 'com.google.gms:google-services:4.3.0'
}
copied to clipboard

Add the apply plugin to the [project]/android/app/build.gradle file.

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
copied to clipboard
Note: If this section is not completed you will get an error like this:
java.lang.IllegalStateException:
Default FirebaseApp is not initialized in this process [package name].
Make sure to call FirebaseApp.initializeApp(Context) first.
copied to clipboard
Note: When you are debugging on android, use a device or AVD with Google Play services.
Otherwise you will not be able to use Firebase Remote Config and Fire Flag.
Use the plugin #
Add the following imports to your Dart code:
import 'package:flag_feature/flag_feature.dart';
copied to clipboard
Initialize FeatureFlag:

static final features = Features(features: [
Feature(
name: 'brandOverview', // Feature name, must be the same with the name on (Firebase Remote Config console)[https://console.firebase.google.com/].
isEnabled: false, // Feature status
),
]);

var featureFlag = FeatureFlag(
features: features
),
copied to clipboard
You can now subscribe to feature flag subscription stream to get the latest status of the feature.

Features _features = features;

featureFlag
.featureFlagSubscription()
.listen((updatedFeatures) {
_features = updatedFeatures
});
copied to clipboard
Example #
See the example application source
for a complete sample app using the Fire Flag.
Issues and feedback #
Please file specific issues, bugs, or feature requests in our issue tracker.
To contribute a change to this plugin, open a pull request.

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.