Skip to content

maxint-app/teller_connect

Repository files navigation

Teller Connect for Flutter

Teller.io connect SDK for Flutter.

See Sidecar documentation and Teller first-party support for React and other platforms for instructions on how to integrate Teller Connect.

Configurations

Requirements

Fulfill

Web

Add following to your web/index.html's <head> section

<script defer type="application/javascript" src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js"></script>
<script defer type="application/javascript" src="https://cdn.teller.io/connect/connect.js"></script>

Android

Follow Android Setup to setup flutter_inappwebview for Android.

iOS

Follow iOS Setup to setup flutter_inappwebview for iOS.

macOS

Follow macOS Setup to setup flutter_inappwebview for macOS.

Install

Add teller_connect via pub:

$ flutter pub add teller_connect

Usage

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) => MaterialApp(
        title: 'Teller Connect Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: const MyHomePage(title: 'Teller Connect Demo'),
      );
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: Text(title),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              final result = await Navigator.of(context).push<TellerData>(
                MaterialPageRoute(
                  builder: (context) => const TellerConnect(
                    config: const TellerConfig(
                      appId: "your-app-id",
                      environment: TellerEnvironment.sandbox,
                    ),
                    onSuccess: (enrollment){
                      Navigator.pop(context, enrollment);
                    },
                    onError: (){
                      Navigator.pop(context);
                    },
                  ),
                ),
              );
              print(result);
            },
            child: const Text("Connect"),
          ),
        ),
      );
}

Publisher

Maxint.com

License

MIT