link_plaid 1.1.6
link_plaid: ^1.1.6

Flutter Android iOS

Plaid Link for Flutter. Integrates the native iOS and Android SDKs.

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  PlaidLink _plaidPublicKey, _plaidLinkToken;

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

    LinkConfiguration publicKeyConfiguration = LinkConfiguration(
      clientName: "CLIENT_NAME",
      publicKey: "PUBLIC_KEY",
      env: LinkEnv.sandbox,
      products: <LinkProduct>[
        LinkProduct.auth,
      ],
      accountSubtypes: {
        "depository": ["checking", "savings"],
      },
      language: "en",
      countryCodes: ['US'],
      userLegalName: "John Appleseed",
      userEmailAddress: "jappleseed@youapp.com",
      userPhoneNumber: "+1 (512) 555-1234",
    );

    LinkConfiguration linkTokenConfiguration = LinkConfiguration(
      linkToken: "link-sandbox-3cec3ce1-1114-4953-837a-7d84f524ceb4",
    );

    _plaidPublicKey = PlaidLink(
      configuration: publicKeyConfiguration,
      onSuccess: _onSuccessCallback,
      onEvent: _onEventCallback,
      onExit: _onExitCallback,
    );

    _plaidLinkToken = PlaidLink(
      configuration: linkTokenConfiguration,
      onSuccess: _onSuccessCallback,
      onEvent: _onEventCallback,
      onExit: _onExitCallback,
    );
  }

  void _onSuccessCallback(String publicToken, LinkSuccessMetadata metadata) {
    print("onSuccess: $publicToken, metadata: ${metadata.description()}");
  }

  void _onEventCallback(String event, LinkEventMetadata metadata) {
    print("onEvent: $event, metadata: ${metadata.description()}");
  }

  void _onExitCallback(String error, LinkExitMetadata metadata) {
    print("onExit: $error, metadata: ${metadata.description()}");
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Container(
          width: double.infinity,
          color: Colors.lightBlue,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              RaisedButton(
                onPressed: () => _plaidPublicKey.open(),
                child: Text("Open Plaid Link (Public Key)"),
              ),
              RaisedButton(
                onPressed: () => _plaidLinkToken.open(),
                child: Text("Open Plaid Link (Link Token)"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
90
pub points
25%
popularity

Plaid Link for Flutter. Integrates the native iOS and Android SDKs.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

tan@retailkit.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on link_plaid