firebase_remote_config 0.2.0+7

firebase_remote_config plugin #

A Flutter plugin to use the Firebase Remote Config API.

pub package

For Flutter plugins for other Firebase products, see

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

Usage #

Import the firebase_remote_config plugin #

To use the firebase_remote_config plugin, follow the plugin installation instructions.

Android integration #

Enable the Google services by configuring the Gradle scripts as such.

  1. Add the classpath to the [project]/android/build.gradle file.
dependencies {
  // Example existing classpath
  classpath ''
  // Add the google services classpath
  classpath ''
  1. Add the apply plugin to the [project]/android/app/build.gradle file.
apply plugin: ''

Note: If this section is not completed you will get an error like this:

Default FirebaseApp is not initialized in this process [package name].
Make sure to call FirebaseApp.initializeApp(Context) first.

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.

Use the plugin #

Add the following imports to your Dart code:

import 'package:firebase_remote_config/firebase_remote_config.dart';

Initialize RemoteConfig:

final RemoteConfig remoteConfig = await RemoteConfig.instance;

You can now use the Firebase remoteConfig to fetch remote configurations in your Dart code, e.g.

final defaults = <String, dynamic>{'welcome': 'default welcome'};
await remoteConfig.setDefaults(defaults);

await remoteConfig.fetch(expiration: const Duration(hours: 5));
await remoteConfig.activateFetched();
print('welcome message: ' + remoteConfig.getString('welcome'));

Example #

See the example application source for a complete sample app using the Firebase Remote Config.

Issues and feedback #

Please file issues to send feedback or report a bug. Thank you!

0.2.0+7 #

  • Fix Bad state: Future already completed error when initially calling RemoteConfig.instance multiple times in parallel.

0.2.0+6 #

  • Update documentation to reflect new repository location.
  • Update unit tests to call TestWidgetsFlutterBinding.ensureInitialized.

0.2.0+5 #

  • Update google-services Android gradle plugin to 4.3.0 in documentation and examples.

0.2.0+4 #

  • Fixed a bug where RemoteConfigValue could incorrectly report a remote source for default values.
  • Added an integration test for the fixed behavior of source.
  • Removed a test that made integration test flaky.

0.2.0+3 #

  • Automatically use version from pubspec.yaml when reporting usage to Firebase.

0.2.0+2 #

  • Add missing template type parameter to invokeMethod calls.
  • Bump minimum Flutter version to 1.5.0.
  • Replace invokeMethod with invokeMapMethod wherever necessary.

0.2.0+1 #

  • Minor internal code cleanup in Java implementation.

0.2.0 #

  • Update Android dependencies to latest.

0.1.0+3 #

  • Initial integration tests.

0.1.0+2 #

  • Log messages about automatic configuration of the default app are now less confusing.

0.1.0+1 #

  • Log a more detailed warning at build time about the previous AndroidX migration.

0.1.0 #

  • Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.

0.0.6+1 #

  • Bump Android dependencies to latest.

0.0.6 #

  • Allowed extending the RemoteConfig class.

0.0.5 #

  • Bump Android and Firebase dependency versions.

0.0.4 #

  • Updated Gradle tooling to match Android Studio 3.1.2.

0.0.3 #

  • Added missing await in setDefaults.
  • Fixed example code in README.

0.0.2 #

  • Update iOS plugin so that it returns fetch status as a String instead of an int.
  • Bump Android library version to 15.+. The Android plugins for FlutterFire need to all be on the same version. Updating Remote Config to match other FlutterFire plugins.

0.0.1 #

  • Implement Firebase Remote Config.


firebase_remote_config_example #

Demonstrates how to use the firebase_remote_config plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  firebase_remote_config: ^0.2.0+7

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:firebase_remote_config/firebase_remote_config.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Sep 19, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
firebase_core ^0.4.0
test any