plaid_link 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • new60

plaid_link #

Plaid Link for Flutter (web and android).

web_demo android_demo

Example #

PlaidLink.open(
  const PlaidLinkOptions(
    publicKey: 'YOUR_PLAID_PUBLIC_KEY',
    env: PlaidEnv.sandbox,
    clientName: 'Plaid Link Example',
    products: [PlaidProduct.transactions],
    language: 'en',
  ),
  onSuccess: (publicToken, _) {
    print('Success: $publicToken');
  },
);

Android Setup #

This package uses the Plaid Android SDK.

You must add your Android package (i.e. app.firelab.plaid_link_example) in your Plaid settings.

Web Setup #

This package uses the Plaid Link JS library.

Remember to include the library in your HTML page (usually index.html). See the example.

<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>

iOS Setup #

This package does not presently support iOS. Pull requests are welcomed! :)

Changelog #

0.0.4 #

  • Add a description, because pub.dev says so.

0.0.3 #

  • Add some documentation, make internal libs private.

0.0.2 #

  • Make repo public.

0.0.1 #

  • Initial commit

example/lib/main.dart

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

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Plaid Link Example'),
        ),
        body: AppContent(),
      ),
    ),
  );
}

// Options can be const if desired.
const plaidLinkOptions = const PlaidLinkOptions(
  clientName: 'Plaid Link Example',
  publicKey: 'YOUR_PLAID_PUBLIC_KEY',
  env: PlaidEnv.sandbox,
  products: [PlaidProduct.auth],
  language: 'en',
);

class AppContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: RaisedButton(
        child: Text('Open Plaid'),
        onPressed: () {
          PlaidLink.open(
            plaidLinkOptions,
            onEvent: onEvent,
            onSuccess: onSuccess(context),
            onExit: onExit(context),
          );
        },
      ),
    );
  }

  void onEvent(PlaidEventName event, PlaidEventMetadata metadata) {
    print('Got event: event=$event, metadata=$metadata');
  }

  PlaidSuccessCallback onSuccess(BuildContext context) {
    return (String publicToken, PlaidSuccessMetadata metadata) {
      showDialog(
        context: context,
        builder: (context) {
          return AlertDialog(
            content: Column(
              children: [
                Text('Successful Plaid Link'),
                Text('publicToken: $publicToken'),
                Text('linkSessionId: ${metadata.linkSessionId}'),
                Text('accounts.name: ${metadata.accounts.map((a) => a.name).toList()}'),
                Text('institution.name: ${metadata.institution.name}'),
              ],
            ),
            actions: [
              FlatButton(
                child: Text('Okay'),
                onPressed: () => Navigator.of(context).pop(),
              ),
            ],
          );
        },
      );
    };
  }

  PlaidExitCallback onExit(BuildContext context) {
    return (PlaidError error, PlaidExitMetadata metadata) {
      showDialog(
        context: context,
        builder: (context) {
          return AlertDialog(
            content: Column(
              children: [
                Text('Exited Plaid Link'),
                Text('error: $error'),
                Text('linkSessionId: ${metadata.linkSessionId}'),
              ],
            ),
            actions: [
              FlatButton(
                child: Text('Okay'),
                onPressed: () => Navigator.of(context).pop(),
              ),
            ],
          );
        },
      );
    };
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  plaid_link: ^0.0.4

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

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform ios

Because of import path [package:plaid_link/plaid_link.dart] that declares support for platforms: android, web

Package does not support Flutter platform linux

Because of import path [package:plaid_link/plaid_link.dart] that declares support for platforms: android, web

Package does not support Flutter platform macos

Because of import path [package:plaid_link/plaid_link.dart] that declares support for platforms: android, web

Package does not support Flutter platform windows

Because of import path [package:plaid_link/plaid_link.dart] that declares support for platforms: android, web

Package not compatible with SDK dart

because of import path [plaid_link] that is in a package requiring null.

Health suggestions

Format lib/plaid_js.dart.

Run flutter format to format lib/plaid_js.dart.

Format lib/plaid_link.dart.

Run flutter format to format lib/plaid_link.dart.

Format lib/plaid_link_web.dart.

Run flutter format to format lib/plaid_link_web.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
flutter_web_plugins 0.0.0
js ^0.6.2 0.6.2
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test