flutter_facebook_connect 0.0.4+1

  • README.md
  • Example
  • Installing
  • Versions
  • 23



No maintenance on this package anymore. Prefer to use flutter_facebook_login

Facebook Connect for Flutter

Easy way to connect users to Facebook inside your application via OAuth2


See configuration for flutter_webview_plugin

Redirection Url need to be http://localhost:8080.

iOS Configuration

Add following lines to Info.plist


Dart Code

Using FacebookConnect class

final _facebookConnect = new FacebookConnect(
          appId: '<APP_ID>',
          clientSecret: '<CLIENT_SECRET');

FacebookOAuthToken token = await _facebookConnect.login();

Using FacebookLoginButton widget

 new FacebookLoginButton(
          appId: '<APP_ID>',
          clientSecret: '<CLIENT_SECRET>',
          scope: [FacebookAuthScope.publicProfile],
          onConnect: (api, token) {

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • fix #4
  • fix facebook logo size


  • Add FacebookLoginButton Widget
  • Remove FacebookOptions class


  • Optional token storage


  • Initial version, created by Stagehand


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

void main() {
  runApp(new MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      home: new MyHomePage(title: 'Flutter Demo Home Page'),

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  _MyHomePageState createState() => new _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  FacebookConnect _connect;

  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text(widget.title),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Container(
                child: new Text(
                    _connect?.token != null ? "connected" : "not connected"),
                padding: new EdgeInsets.all(8.0),
              new FacebookLoginButton(
                  appId: '<APP_ID>',
                  clientSecret: '<CLIENT_SECRET>',
                  scope: [FacebookAuthScope.publicProfile],
                  cookie: false,
                  onConnect: (api, token) {
                    _connect = api;
                    setState(() {});
              new FlatButton(
                  onPressed: () {
                    setState(() {});
                  child: new Text("Logout"))

Use this package as a library

1. Depend on it

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

  flutter_facebook_connect: ^0.0.4+1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or 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:flutter_facebook_connect/flutter_facebook_connect.dart';
Version Uploaded Documentation Archive
0.0.4+1 Mar 11, 2018 Go to the documentation of flutter_facebook_connect 0.0.4+1 Download flutter_facebook_connect 0.0.4+1 archive
0.0.4 Jan 20, 2018 Go to the documentation of flutter_facebook_connect 0.0.4 Download flutter_facebook_connect 0.0.4 archive
0.0.3 Jul 30, 2017 Go to the documentation of flutter_facebook_connect 0.0.3 Download flutter_facebook_connect 0.0.3 archive
0.0.2 Jul 24, 2017 Go to the documentation of flutter_facebook_connect 0.0.2 Download flutter_facebook_connect 0.0.2 archive
0.0.1 Jul 24, 2017 Go to the documentation of flutter_facebook_connect 0.0.1 Download flutter_facebook_connect 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.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0