apn_fb_login 0.0.1

  • README.md
  • Example
  • Installing
  • Versions
  • 21


A flutter plugin project that allows you to easily connect to Facebook and get your profile information


iOS configuration

Edit your Info.plist and add add the following:


Change ##APPID## and ##APPNAME##

Android configuration



Import the lib:

import 'package:apn_fb_login/apn_fb_login.dart';

Define a FacebookConnect object:

final _facebookConnect = new FacebookConnect(
    appId: '##APPID##',
    clientSecret: '##APPSECRET##');

Authenticate like so:

ApnFbLogin.login(_facebookConnect).then((FacebookOAuthToken token) {
  this.token = token;
}).catchError((dynamic error) {

Use the FacebookOAuthToken to get the graph/me result:

ApnFbLogin.me().then((FacebookUser user) {
  this.user = user;
}).catchError((dynamic error) {

See the project in /example for a more complete example


For help getting started with Flutter, view our online documentation.

[0.0.1] - December 03, 2017

  • First release, basic auth and graph/me call to get FacebookUser.


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

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

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  bool isloading = false;
  FacebookOAuthToken token;
  FacebookUser user;
  String data;

  /// Get your app id and secret at https://developers.facebook.com
  final _facebookConnect = new FacebookConnect(
      appId: '##APPID##',
      clientSecret: '##APPSECRET##');

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Facebook login'),
        body: _body(),
        floatingActionButton: new FloatingActionButton(
          child: new Icon(token == null ? Icons.lock_open : Icons.face),
          onPressed: () {
            if (isloading) return;

            _setResult(true, null);
            if (token == null)

  void _doLogin() {
    ApnFbLogin.login(_facebookConnect).then((FacebookOAuthToken token) {
      this.token = token;
      _setResult(false, token.toString());
    }).catchError((dynamic error) {
      _setResult(false, null);

  void _queryMe() {
    ApnFbLogin.me().then((FacebookUser user) {
      this.user = user;
      _setResult(false, user.toString());
    }).catchError((dynamic error) {
      _setResult(false, null);

  Widget _body() {
    if (this.isloading) {
      return new Center(child: new CircularProgressIndicator());
    } else if (this.user != null) {
      return new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            _textWidget("Got user!\nWelcome ${user.name}"),
            new ClipOval(child: new Image.network(this.user.avatarUrl)),
    } else if (this.token != null) {
      return _textWidget("Authorized!\nClick again to query /me");
    } else {
      return _textWidget("Click the button to connect with Facebook");

  void _setResult(bool loading, String data) {
    setState(() {
      this.isloading = loading;
      this.data = data;

  Widget _textWidget(String text) =>
      new Container(
        padding: new EdgeInsets.all(8.0),
        child: new Center(
          child: new Text(
            textAlign: TextAlign.center,


Use this package as a library

1. Depend on it

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

  apn_fb_login: ^0.0.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:apn_fb_login/apn_fb_login.dart';
Version Uploaded Documentation Archive
0.0.6 Dec 12, 2018 Go to the documentation of apn_fb_login 0.0.6 Download apn_fb_login 0.0.6 archive
0.0.5 Dec 12, 2018 Go to the documentation of apn_fb_login 0.0.5 Download apn_fb_login 0.0.5 archive
0.0.4 Dec 29, 2017 Go to the documentation of apn_fb_login 0.0.4 Download apn_fb_login 0.0.4 archive
0.0.3 Dec 8, 2017 Go to the documentation of apn_fb_login 0.0.3 Download apn_fb_login 0.0.3 archive
0.0.2 Dec 3, 2017 Go to the documentation of apn_fb_login 0.0.2 Download apn_fb_login 0.0.2 archive
0.0.1 Dec 3, 2017 Go to the documentation of apn_fb_login 0.0.1 Download apn_fb_login 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.

Health issues and suggestions

Fix lib/apn_fb_login.dart. (-43.75 points)

Analysis of lib/apn_fb_login.dart failed with 2 errors:

line 18 col 59: The argument type '(Map<String, String>) → FacebookOAuthToken' can't be assigned to the parameter type '(dynamic) → FutureOr<FacebookOAuthToken>'.

line 28 col 62: The argument type '(Map<String, String>) → FacebookUser' can't be assigned to the parameter type '(dynamic) → FutureOr<FacebookUser>'.

Document public APIs. (-1 points)

79 out of 79 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-50 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Homepage URL does not exists. (-20 points)

We were unable to access https://www.appnormal.com at the time of the analysis.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is getting outdated. (-11.78 points)

The package was released 58 weeks ago.

Package is pre-v0.1 release. (-10 points)

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


Package Constraint Resolved Available
Direct dependencies
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8