firebase_remote_config 0.0.6+1

  • Example
  • Installing
  • Versions
  • 94

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!


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'));


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!


  • Bump Android dependencies to latest.


  • Allowed extending the RemoteConfig class.


  • Bump Android and Firebase dependency versions.


  • Updated Gradle tooling to match Android Studio 3.1.2.


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


  • 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.


  • Implement Firebase Remote Config.


import 'dart:async';

import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/material.dart';

void main() {
      title: 'Remote Config Example',
      home: FutureBuilder<RemoteConfig>(
        future: setupRemoteConfig(),
        builder: (BuildContext context, AsyncSnapshot<RemoteConfig> snapshot) {
          return snapshot.hasData
              ? WelcomeWidget(remoteConfig:
              : Container();

class WelcomeWidget extends AnimatedWidget {
  WelcomeWidget({this.remoteConfig}) : super(listenable: remoteConfig);

  final RemoteConfig remoteConfig;

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Remote Config Example'),
      body: Center(child: Text('Welcome ${remoteConfig.getString('welcome')}')),
      floatingActionButton: FloatingActionButton(
          child: const Icon(Icons.refresh),
          onPressed: () async {
            try {
              // Using default duration to force fetching from remote server.
              await remoteConfig.fetch(expiration: const Duration(seconds: 0));
              await remoteConfig.activateFetched();
            } on FetchThrottledException catch (exception) {
              // Fetch throttled.
            } catch (exception) {
                  'Unable to fetch remote config. Cached or default values will be '

Future<RemoteConfig> setupRemoteConfig() async {
  final RemoteConfig remoteConfig = await RemoteConfig.instance;
  // Enable developer mode to relax fetch throttling
  remoteConfig.setConfigSettings(RemoteConfigSettings(debugMode: true));
  remoteConfig.setDefaults(<String, dynamic>{
    'welcome': 'default welcome',
    'hello': 'default hello',
  return remoteConfig;

Use this package as a library

1. Depend on it

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

  firebase_remote_config: ^0.0.6+1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages 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';
Version Uploaded Documentation Archive
0.0.6+1 Oct 12, 2018 Go to the documentation of firebase_remote_config 0.0.6+1 Download firebase_remote_config 0.0.6+1 archive
0.0.5 Jul 23, 2018 Go to the documentation of firebase_remote_config 0.0.5 Download firebase_remote_config 0.0.5 archive
0.0.2 May 7, 2018 Go to the documentation of firebase_remote_config 0.0.2 Download firebase_remote_config 0.0.2 archive
0.0.1 Apr 30, 2018 Go to the documentation of firebase_remote_config 0.0.1 Download firebase_remote_config 0.0.1 archive
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 Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.


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
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
firebase_core ^0.2.5+1