flutter_signin_button 0.2.8

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

Pub version and score badges are created from a third party tool. Go for instruction here

Feedback welcome and Pull Requests are most welcome!

Installation #

Add to pubspec.yaml.

dependencies:
  ...
  flutter_signin_button: ^0.2.8

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

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.2.8

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]
95
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
96
Overall:
Weighted score of the above. [more]
96
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/button_builder.dart. (-0.50 points)

Analysis of lib/button_builder.dart reported 1 hint:

line 50 col 5: Don't explicitly initialize variables to null.

Fix lib/button_view.dart. (-0.50 points)

Analysis of lib/button_view.dart reported 1 hint:

line 27 col 75: Don't explicitly initialize variables to null.

Maintenance suggestions

Update README.md. (-4 points)

2 image links are insecure (e.g. http://flutter-badge.zaynjarvis.com/version/flutter_signin_button), use https URLs instead.

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.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test