flutter_slack_oauth_firebase 0.4.1

pub package

flutter_slack_oauth_firebase #

Extension for our flutter_slack_oauth library which adds support for Firebase Authentication and Cloud Firestore.

Usage #

  • To use this plugin, add flutter_slack_oauth_firebase as a dependency in your pubspec.yaml file.

  • This package depends on Firebase Auth, so be sure to follow those steps. Unlike the documentation for that package, the Google Sign-in plugin for Firebase Auth is NOT required!

  • Deploy the Firebase Functions project in the firebase folder, which is the "backend" logic that will handle the OAuth flow. You can follow the steps as specified in the Instagram Oauth Firebase Functions sample.

After succesful login #

  • The resulting access token for Slack is stored in Firebase Firestore in the slackAccessToken collection under a document with the Slack UID as document id.
  • User info returned from the Slack login is stored in Firebase Firestore in the users collection under a document with the Slack UID as document id.
  • You can easily find the Slack UID for the current user after login:
FirebaseUser user = await _auth.currentUser();

Full Example #

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_slack_oauth_firebase/flutter_slack_oauth_firebase.dart';

void main() {
  final FirebaseAuth _auth = FirebaseAuth.instance;

  runApp(new MaterialApp(
    home: new Scaffold(
      appBar: new AppBar(
        title: new Text("Slack OAuth Example"),
      body: new Builder(
        builder: (BuildContext context) {
          return new Center(
            child: new FirebaseSlackButton(
              clientId: "XXX_CLIENT_ID_XXX",
              clientSecret: "XXX_CLIENT_SECRET_XXX",
              onSuccess: () async {
                // get Firebase User:
                FirebaseUser user = await _auth.currentUser();

                Scaffold.of(context).showSnackBar(new SnackBar(
                  content: new Text('Logged in with Slack ID ' + user.uid),
              onFailure: () {
                Scaffold.of(context).showSnackBar(new SnackBar(
                      content: new Text('Slack Login Failed'),
              onCancelledByUser: () {
                Scaffold.of(context).showSnackBar(new SnackBar(
                      content: new Text('Slack Login Cancelled by user'),

[0.4.1] - 8 April 2019

  • Bumped flutter_slack_oauth dependency.

[0.4.0] - 8 April 2019

  • BREAKING AndroidX support.

[0.3.1] - 25 January 2019

  • Bumped flutter_webview_plugin dependency for Flutter 1.0 compatibility

[0.3.0] - 18 January 2019

  • Updated with new Slack icon
  • Refactored widgets to Stateless where possible

[0.2.1] - 18 October 2018

  • BREAKING - Required for Flutter 0.9.4 beta
  • Updated deprecated dependencies.

[0.2.0] - 28 September 2018

  • Updated deprecated dependencies.

[0.0.4] - 28 May 2018

  • Bugfix in tokenReceived function, thanks to js1972 for pointing it out.

[0.0.3] - 18 May 2018

  • Clear the cache and cookies on webview access.

[0.0.2] - 10 April 2018

  • Updated flutter_slack_oauth dependency to support Flutter Beta 2 (and Dart 2).

[0.0.1] - 30 March 2018

  • Initial release
  • The resulting access token is stored in Firebase Firestore in the slackAccessToken collection.
  • User info returned from the Slack login is stored in Firebase Firestore in the users collection.
  • Both collections contain documents with the Slack UID as the document name.


example #

flutter_slack_oauth example

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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

  flutter_slack_oauth_firebase: ^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_slack_oauth_firebase/flutter_slack_oauth_firebase.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 Jul 18, 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.3


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/flutter_slack_oauth_firebase.dart.

Run flutter format to format lib/flutter_slack_oauth_firebase.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (firebase_auth).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
firebase_auth ^0.8.4+2 0.8.4+5 0.11.1+11
flutter 0.0.0
flutter_slack_oauth ^0.4.0 0.4.0
flutter_webview_plugin ^0.3.3 0.3.5
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11
firebase_core 0.3.4 0.4.0+6
http 0.12.0+2
http_parser 3.1.3
meta 1.1.6 1.1.7
path 1.6.2
pedantic 1.8.0+1
shared_preferences 0.5.3+4
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8