firebase_core 0.2.5+1

  • Example
  • Installing
  • Versions
  • 99

Firebase Core for Flutter

pub package

A Flutter plugin to use the Firebase Core API, which enables connecting to multiple Firebase apps.

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!


To use this plugin, add firebase_core as a dependency in your pubspec.yaml file.

Getting Started

See the example directory for a complete sample app using Firebase Core.


  • Bump Android dependencies to latest.


  • Bump Android and Firebase dependency versions.


  • Updated Gradle tooling to match Android Studio 3.1.2.


  • Updated Google Play Services dependencies to version 15.0.0.


  • Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives.


  • Fix setting project ID on Android.


  • Breaking change. Options API is now async to interoperate with native code that configures Firebase apps.
  • Provide a getter for the default app
  • Fix setting of GCM sender ID on iOS


  • Fix projectID on iOS


  • Fix behavior of constructor for named Firebase apps.


  • Breaking change. Set SDK constraints to match the Flutter beta release.


  • Fixed Dart 2 type errors.


  • Enabled use in Swift projects.


  • Moved to the io.flutter.plugins org.


  • Fixed warnings from the Dart 2.0 analyzer.
  • Simplified and upgraded Android project template to Android SDK 27.
  • Updated package description.


  • Breaking change. Upgraded to Gradle 4.1 and Android Studio Gradle plugin 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in order to use this version of the plugin. Instructions can be found here.


  • Fixes for database URL on Android
  • Make GCM sender id optional on Android
  • Relax GMS dependency to 11.+


  • Initial Release


import 'dart:async';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  final String name = 'foo';
  final FirebaseOptions options = const FirebaseOptions(
    googleAppID: '1:297855924061:ios:c6de2b69b03a5be8',
    gcmSenderID: '297855924061',
    apiKey: 'AIzaSyBq6mcufFXfyqr79uELCiqM_O_1-G72PVU',

  Future<Null> _configure() async {
    final FirebaseApp app = await FirebaseApp.configure(
      name: name,
      options: options,
    assert(app != null);
    print('Configured $app');

  Future<Null> _allApps() async {
    final List<FirebaseApp> apps = await FirebaseApp.allApps();
    print('Currently configured apps: $apps');

  Future<Null> _options() async {
    final FirebaseApp app = await FirebaseApp.appNamed(name);
    final FirebaseOptions options = await app?.options;
    print('Current options for app $name: $options');

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Firebase Core example app'),
        body: Padding(
          padding: const EdgeInsets.all(20.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
                  onPressed: _configure, child: const Text('initialize')),
              RaisedButton(onPressed: _allApps, child: const Text('allApps')),
              RaisedButton(onPressed: _options, child: const Text('options')),

Use this package as a library

1. Depend on it

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

  firebase_core: ^0.2.5+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_core/firebase_core.dart';
Version Uploaded Documentation Archive
0.2.5+1 Oct 5, 2018 Go to the documentation of firebase_core 0.2.5+1 Download firebase_core 0.2.5+1 archive
0.2.5 Jul 23, 2018 Go to the documentation of firebase_core 0.2.5 Download firebase_core 0.2.5 archive
0.2.4 Jun 1, 2018 Go to the documentation of firebase_core 0.2.4 Download firebase_core 0.2.4 archive
0.2.3 Apr 18, 2018 Go to the documentation of firebase_core 0.2.3 Download firebase_core 0.2.3 archive
0.2.2 Apr 11, 2018 Go to the documentation of firebase_core 0.2.2 Download firebase_core 0.2.2 archive
0.2.1 Apr 10, 2018 Go to the documentation of firebase_core 0.2.1 Download firebase_core 0.2.1 archive
0.2.0 Apr 9, 2018 Go to the documentation of firebase_core 0.2.0 Download firebase_core 0.2.0 archive
0.1.2 Apr 2, 2018 Go to the documentation of firebase_core 0.1.2 Download firebase_core 0.1.2 archive
0.1.1 Apr 2, 2018 Go to the documentation of firebase_core 0.1.1 Download firebase_core 0.1.1 archive
0.1.0 Mar 9, 2018 Go to the documentation of firebase_core 0.1.0 Download firebase_core 0.1.0 archive

All 16 versions...

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 Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0


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
meta ^1.0.5 1.1.6
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies