fbsdk 0.0.2 copy "fbsdk: ^0.0.2" to clipboard
fbsdk: ^0.0.2 copied to clipboard

Dart 1 only

Facebook SDK for flutter.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:fbsdk/login_kit.dart';
import 'package:fbsdk/share_kit.dart';

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: new Center(
          child: new Column(children: [
            new Container(
              child: new RaisedButton(
                  child: new Text("Login to Facebook"),
                  onPressed: () async {
                    final response = await FacebookLoginKit
                        .loginWithReadPermissions(["public_profile"]);
                    print(response);
                  }),
              margin: const EdgeInsets.only(top: 32.0),
            ),
            new Container(
              child: new RaisedButton(
                child: new Text("Share some content"),
                onPressed: () async {
                  final response =
                      await FacebookShareKit.shareLinkWithShareDialog({
                    "contentType": 'link',
                    "contentUrl": "https://facebook.com",
                    "contentDescription": 'Wow, check out this great site!'
                  });
                  print(response);
                },
              ),
              margin: const EdgeInsets.only(top: 32.0),
            )
          ]),
        ),
      ),
    );
  }
}
0
likes
15
pub points
0%
popularity

Publisher

unverified uploader

Facebook SDK for flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on fbsdk