plaid_flutter 0.2.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 74

Plaid Link plugin for Flutter #

pub

A Flutter plugin for Plaid Link.

This plugin integrates the native SDKs:

Note: Feedback and Pull Requests are most welcome!

Installation #

Add plaid_flutter as a dependency in your pubspec.yaml file.

iOS #

  1. Add a Run Script build phase (name it Prepare for Distribution for example) with the script below. Be sure to run this build phase after the Embed Frameworks build phase (or [CP] Embed Pods Frameworks build phase when integrating using CocoaPods)
LINK_ROOT=${PODS_ROOT:+$PODS_ROOT/Plaid}
cp "${LINK_ROOT:-$PROJECT_DIR}"/LinkKit.framework/prepare_for_distribution.sh "${CODESIGNING_FOLDER_PATH}"/Frameworks/LinkKit.framework/prepare_for_distribution.sh
"${CODESIGNING_FOLDER_PATH}"/Frameworks/LinkKit.framework/prepare_for_distribution.sh

NOTE: More info at https://plaid.com/docs/link/ios.

Android #

  1. Log into your Plaid Dashboard at the API page and add a new Allowed Android package name (for example com.plaid.example) and a new Allowed redirect URI.

NOTE: More info at https://plaid.com/docs/link/android.

Usage Example #

import 'package:plaid_flutter/plaid_flutter.dart';

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  PlaidLink _plaidLink;
  
  @override
  void initState() {
    super.initState();
  
    _plaidLink = PlaidLink(
      clientName: "CLIENT_NAME",        //required
      publicKey: "PUBLIC_KEY",          //required
      env: EnvOption.sandbox,           //required
      products: <ProductOption>[        //required
        ProductOption.auth,
      ],
      oauthRedirectUri: "myapp://test",
      oauthNonce: "XXXXXXXXXXXXXXXX",   
      onAccountLinked: (publicToken, metadata) { print("onAccountLinked: $publicToken metadata: $metadata"); },
      onAccountLinkError: (error, metadata) { print("onAccountError: $error metadata: $metadata"); },
      onEvent: (event, metadata) { print("onEvent: $event metadata: $metadata"); },
      onExit: (metadata) { print("onExit: $metadata"); },
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: 
        Center( 
            child: 
            RaisedButton(
              onPressed: () {
                _plaidLink.open();
              },
              child: Text("Open Plaid Link"),
          	),
        ),
      ),
    );
  }
}

TODOs #

0.2.2 #

  • Added iOS support for account subtype filtering
  • Updated Plaid Android SDK to version 1.2.1

0.2.1 #

  • Small bug fix LinkConfiguration

0.2.0 #

  • Upgrade Plaid Android SDK to version 1.0.0

0.1.2 #

  • pubspec.yaml plugin platform changes

0.1.1 #

  • Minor changes to documentation

0.1.0 #

  • Support for Android
  • Support for oAuthRedirectUri property

0.0.1 #

  • Initial release
  • Support for iOS

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  PlaidLink _plaidLink;

  @override
  void initState() {
    super.initState();

    _plaidLink = PlaidLink(
      clientName: "CLIENT_NAME",
      publicKey: "PUBLIC_KEY",
      oauthRedirectUri: "myapp://test",
      oauthNonce: "XXXXXXXXXXXXXXXX",
      env: EnvOption.sandbox,
      products: <ProductOption>[
        ProductOption.auth,
      ],
      accountSubtypes: {
        "depository": ["checking", "savings"],
      },
      onAccountLinked: (publicToken, metadata) {
        print("onAccountLinked: $publicToken metadata: $metadata");
      },
      onAccountLinkError: (error, metadata) {
        print("onAccountLinkError: $error metadata: $metadata");
      },
      onEvent: (event, metadata) {
        print("onEvent: $event metadata: $metadata");
      },
      onExit: (metadata) {
        print("onExit: $metadata");
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Container(
          color: Colors.lightBlue,
          child: Center(
            child: RaisedButton(
              onPressed: () {
                _plaidLink.open();
              },
              child: Text("Open Plaid Link"),
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  plaid_flutter: ^0.2.2

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:plaid_flutter/plaid_flutter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
48
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]
74
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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.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
flutter_test