firebase_core 0.2.4

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 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_core/firebase_core.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
100
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
79
Overall:
Weighted score of the above. [more]
96
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (meta).

Package is getting outdated. (-10.68 points)

The package was last published 57 weeks ago.

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.6 1.1.7
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test

Admin