flutter_signin_button 0.4.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 98

A Flutter plugin for iOS and Android for generating signin buttons for different social media account.

Feedback and Pull Requests are most welcome!

Installation #

Add to pubspec.yaml.

dependencies:
  ...
  flutter_signin_button: ^0.4.1

Usage Example #

import flutter_signin_button.dart

import 'package:flutter_signin_button/flutter_signin_button.dart';

For built-in buttons. #

SignInButton(
  Buttons.Google,
  onPressed: () {},
)

// with custom text
SignInButton(
  Buttons.Google,
  text: "Sign up with Google",
  onPressed: () {},
)

For mini buttons. #

SignInButton(
  Buttons.Facebook,
  mini: true,
  onPressed: () {},
)

For self-build buttons. #

SignInButtonBuilder(
  text: 'Sign in with Email',
  icon: Icons.email,
  onPressed: () {},
  backgroundColor: Colors.blueGrey[700],
)

Built-in Buttons contain #

enum Buttons {
  Email,
  Google,
  Facebook,
  GitHub,
  LinkedIn,
  Pinterest,
  Tumblr,
  Twitter
}

Refer to example folder and the source code for more information.

0.1.0 #

  • Initial build for flutter sign in button library.

0.1.1 #

  • fix change log
  • update example pubspec

0.1.2 #

  • delete image from root
  • use image from pinterest

0.1.3 #

  • change full example readme to example folder
  • update lisense

0.2.0 #

  • add customizable shape # encountering issues here. currently not responsible
  • add customizable width
  • update lisense
  • delete cupercino icons dependency
  • refactor code

0.2.1 #

  • Update MIT license

0.2.2 #

  • Update documentation of the library.

0.2.3 #

  • Delete shape field since Flutter constraint
  • Change defalt splash color
  • provide user defined splash color in ButtonBuilder Widget

0.2.4 #

  • Fix the bug on email signin button @matthiasbruns
  • Add user configured signin text @matthiasbruns

0.2.5 #

  • Add Flutter Badge on Github Readme According to this repo
  • Add Google Dark button thanks to @g3rrydanc3

0.2.6 #

  • Add Twitter Button
  • Fix mini for Email

0.2.8 #

  • Make text fully customizable thx to @narciero and @LiveLikeCounter

0.3.0 #

  • Add in Shape property
  • Fix mini for email button

0.4.0 #

  • Add in padding
  • Add in custom font-size to solve overflow
  • Add in Signin with Apple

0.4.1 #

  • Fix explicit null initialization

example/README.md

A Complete Example #

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

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

class MyApp extends StatelessWidget {
  /// This is an example app which make use of
  /// `SignInButtonBuilder` and `SignInButton` class
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData.light(),
      home: SignInPage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class SignInPage extends StatelessWidget {
  /// Normally the signin buttons should be contained in the SignInPage
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color.fromRGBO(50, 50, 50, 1.0),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            SignInButtonBuilder(
              text: 'Get going with Email',
              icon: Icons.email,
              onPressed: () {},
              backgroundColor: Colors.blueGrey[700],
              width: 200.0,
            ),
            Divider(),
            SignInButton(
              Buttons.Google,
              onPressed: () {},
            ),
            SignInButton(
              Buttons.Facebook,
              onPressed: () {},
            ),
            SignInButton(
              Buttons.GitHub,
              onPressed: () {},
            ),
            SignInButton(
              Buttons.Pinterest,
              text: "Sign up with Pinterest",
              onPressed: () {},
            ),
            SignInButton(
              Buttons.Twitter,
              text: "Use Twitter",
              onPressed: () {},
            ),
            Divider(),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                SignInButton(
                  Buttons.LinkedIn,
                  mini: true,
                  onPressed: () {},
                ),
                SignInButton(
                  Buttons.Tumblr,
                  mini: true,
                  onPressed: () {},
                ),
                SignInButtonBuilder(
                  icon: Icons.email,
                  text: "Ignored for mini button",
                  mini: true,
                  onPressed: () {},
                  backgroundColor: Colors.cyan,
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_signin_button: ^0.4.1

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_signin_button/flutter_signin_button.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
96
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
98
Learn more about scoring.

We analyzed this package on Oct 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/button_builder.dart.

Run flutter format to format lib/button_builder.dart.

Format lib/button_view.dart.

Run flutter format to format lib/button_view.dart.

Dependencies

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