firebase_core 0.1.0 copy "firebase_core: ^0.1.0" to clipboard
firebase_core: ^0.1.0 copied to clipboard

outdated

Flutter plugin for Firebase Core, enabling connecting to multiple Firebase apps.

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

  @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')),
            ],
          ),
        ),
      ),
    );
  }
}
3637
likes
0
pub points
100%
popularity

Publisher

verified publisherfirebase.google.com

Flutter plugin for Firebase Core, enabling connecting to multiple Firebase apps.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, meta

More

Packages that depend on firebase_core