It’s now made easy for you as a Flutter developer to implement your social media sign-in buttons for Authentication such as Facebook-Button, Twitter button, Google button, and many others. This is one great way of saving time, instead of building and creating a button your self. Here’s how you can achieve this;
Flutter Auth Buttons (for Social Media)
This Flutter widget is a library contains buttons for authenticating with popular social networks.
These Flutter Social Media buttons do not contain authentication logic. They are designed to be used with authentication packages, such as firebase_auth
. Use the onPressed attribute to capture the button press and call your authentication logic within that.
This buttons comes in light and dark mode with different styles to suit your application.
How To Install
dependencies: flutter_auth_buttons: ^0.8.0
GoogleSignInButton(onPressed: () { // call authentication logic });
Supported buttons
Screenshots of the supported buttons are shown below.
Google suggests two default button styles on it’s
branding page.
Light button:
Dark button:
Facebook has fewer guidelines for designing their buttons (see
here). This button was designed to
match the example given in their documentation.
Like Facebook, Twitter doesn’t prescribe a precise button (see
here).
This button was designed to match the colours and style used in their example images.
Usage
Add flutter_auth_buttons
to your pubspec.yaml
, then import the Dart file:
import 'package:flutter_auth_buttons/flutter_auth_buttons.dart';
See the documentation for API details.