firebase_remote_config 0.0.1

  • Example
  • Installing
  • Versions
  • 96

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_auth/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.activate();
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!


  • Implement Firebase Remote Config.


import 'dart:async';

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

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

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

  final RemoteConfig remoteConfig;

  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: const Text('Remote Config Example'),
      body: new Center(
          child: new Text('Welcome ${remoteConfig.getString('welcome')}')),
      floatingActionButton: new 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(new 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.1

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';
Version Uploaded Documentation Archive
0.2.0+1 May 10, 2019 Go to the documentation of firebase_remote_config 0.2.0+1 Download firebase_remote_config 0.2.0+1 archive
0.2.0 May 7, 2019 Go to the documentation of firebase_remote_config 0.2.0 Download firebase_remote_config 0.2.0 archive
0.1.0+3 Apr 19, 2019 Go to the documentation of firebase_remote_config 0.1.0+3 Download firebase_remote_config 0.1.0+3 archive
0.1.0+2 Feb 21, 2019 Go to the documentation of firebase_remote_config 0.1.0+2 Download firebase_remote_config 0.1.0+2 archive
0.1.0+1 Feb 8, 2019 Go to the documentation of firebase_remote_config 0.1.0+1 Download firebase_remote_config 0.1.0+1 archive
0.1.0 Jan 29, 2019 Go to the documentation of firebase_remote_config 0.1.0 Download firebase_remote_config 0.1.0 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 May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15
  • Flutter: 1.5.8


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

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

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

Package is getting outdated. (-1.92 points)

The package was last published 53 weeks ago.


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 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies