Braintree Flutter Drop-In

A Flutter plugin that wraps the native Braintree Drop-In UI SDKs. Currently only supports Android.

Installation

Add braintree to your pubspec.yaml file:

dependencies:
  ...
  braintree_plugin: ^0.0.1

Android

You must migrate to AndroidX.
In /app/build.gradle, set your minSdkVersion to at least 21.

Usage

Import the plugin:

import 'package:braintree_plugin/braintree_plugin.dart';

Create a drop-in request object:

  Future<void> _pay(String token) async {
    String nonce;
    try {
      nonce = await BraintreePlugin.showDropIn(token);
    } catch (e) {
      nonce = e.message;
    }

    setState(() {
      _nonce = nonce;
    });
  }

Libraries

braintree_plugin
i18n