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.
Fulfill
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>
Follow Android Setup to setup flutter_inappwebview
for Android.
Follow iOS Setup to setup flutter_inappwebview
for iOS.
Follow macOS Setup to setup flutter_inappwebview
for macOS.
Add teller_connect
via pub
:
$ flutter pub add teller_connect
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"),
),
),
);
}