flutter_auth_buttons 0.7.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 98

Flutter Auth Buttons #

Build Status

Flutter widget library containing buttons for authenticating with popular social networks: Apple, Google, Facebook, Twitter and Microsoft.


Usage #

Add flutter_auth_buttons to your pubspec.yaml, then import the Dart file:

import 'package:flutter_auth_buttons/flutter_auth_buttons.dart';

Use the onPressed attribute to capture the button press and call your authentication logic within that. To disable the button, pass null or omit the attribute.

FacebookSignInButton(onPressed: () {
  // call authentication logic

Some buttons have a dark mode. Enable this with the optional parameter:

  onPressed: () {/* ... */}, 
  darkMode: true, // default: false

You can adjust the border-radius of the buttons:

  onPressed: () {},
  borderRadius: 10.0,

You can adjust the text style of the buttons:

  onPressed: () {},
  textStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.w700, fontFamily: "Roboto"),

See the documentation for API details: https://pub.dartlang.org/documentation/flutter_auth_buttons/latest/.

Contributions #

Contributions are very welcome. I would recommend discussing large changes in an issue before you spend the time on them.

Good quality pull requests will win you commit rights.

[0.7.0] #

  • Text styles can be overridden (thanks @bitmoxy).

[0.6.0] #

  • Added Apple button (thanks @json469).
  • Simplified the example app (removed stretched button examples).

[0.5.0] #

  • Added Microsoft button.

[0.4.0] #

  • Border radius can be specified (thanks @nerder).
  • Google button shows correct background colour when pressed (thanks @g3rrydanc3).
  • Button content left-aligns when stretched.
  • onPressed attribute is no longer required.

[0.3.1] #

  • Improved package description.

[0.3.0] #

  • Added Twitter button.

[0.2.1] #

  • Fix bug to prevent buttons from stretching.

[0.2.0] #

  • Added Facebook button.

[0.1.0] #

  • Added example application.

[0.0.1] #

  • Support for Google button.


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

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

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    const padding = 25.0;

    return MaterialApp(
      title: 'Button Demo',
      home: Scaffold(
        appBar: AppBar(
          title: Text("flutter_auth_buttons"),
        backgroundColor: Color.fromARGB(0xFF, 0xF0, 0xF0, 0xF0),
        body: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
                children: <Widget>[
                  SizedBox(height: padding),
                  AppleSignInButton(onPressed: () {}),
                      onPressed: () {}, style: AppleButtonStyle.whiteOutline),
                      onPressed: () {}, style: AppleButtonStyle.black),
                  SizedBox(height: padding),
                  GoogleSignInButton(onPressed: () {}),
                  GoogleSignInButton(onPressed: () {}, darkMode: true),
                  SizedBox(height: padding),
                  FacebookSignInButton(onPressed: () {}),
                  SizedBox(height: padding),
                  TwitterSignInButton(onPressed: () {}),
                  SizedBox(height: padding),
                  MicrosoftSignInButton(onPressed: () {}),
                  MicrosoftSignInButton(onPressed: () {}, darkMode: true),

class Heading extends StatelessWidget {
  final String text;


  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(top: 12.0, bottom: 12.0),
      child: Text(
        style: TextStyle(
          fontSize: 18.0,
          fontWeight: FontWeight.bold,

Use this package as a library

1. Depend on it

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

  flutter_auth_buttons: ^0.7.0

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:flutter_auth_buttons/flutter_auth_buttons.dart';
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.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/src/apple.dart.

Run flutter format to format lib/src/apple.dart.

Format lib/src/facebook.dart.

Run flutter format to format lib/src/facebook.dart.

Format lib/src/google.dart.

Run flutter format to format lib/src/google.dart.

Format lib/src/microsoft.dart.

Run flutter format to format lib/src/microsoft.dart.

Format lib/src/twitter.dart.

Run flutter format to format lib/src/twitter.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies