firebase_core 0.2.4

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 98

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 FlutterFire.md.

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

Usage

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.

0.2.4

  • Updated Gradle tooling to match Android Studio 3.1.2.

0.2.3

  • Updated Google Play Services dependencies to version 15.0.0.

0.2.2

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

0.2.1

  • Fix setting project ID on Android.

0.2.0

  • 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

0.1.2

  • Fix projectID on iOS

0.1.1

  • Fix behavior of constructor for named Firebase apps.

0.1.0

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

0.0.7

  • Fixed Dart 2 type errors.

0.0.6

  • Enabled use in Swift projects.

0.0.5

  • Moved to the io.flutter.plugins org.

0.0.4

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

0.0.3

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

0.0.2

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

0.0.1

  • Initial Release

example/lib/main.dart

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

void main() => runApp(new 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');
  }

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


dependencies:
  firebase_core: "^0.2.4"

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.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
0.0.7 Feb 28, 2018 Go to the documentation of firebase_core 0.0.7 Download firebase_core 0.0.7 archive
0.0.6 Feb 15, 2018 Go to the documentation of firebase_core 0.0.6 Download firebase_core 0.0.6 archive

All 14 versions...

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3
  • Flutter: 0.5.4

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
96 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
98
Learn more about scoring.

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • Package is pre-v1 release.

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

Dependencies

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.5
Transitive dependencies
collection 1.14.6 1.14.10
sky_engine 0.0.99
typed_data 1.1.5
vector_math 2.0.6 2.0.7
Dev dependencies
flutter_test