go_saffe_flutter 0.1.1 go_saffe_flutter: ^0.1.1 copied to clipboard
Saffe capture flutter package.
GoSaffeCapture Flutter #
Usage #
To use GoSaffeCapture in your application, follow these steps:
- Import the package
go_saffe_flutter/go_saffe_flutter.dart
.
import 'package:go_saffe_flutter/go_saffe_flutter.dart';
- Create an instance of GoSaffeCapture with the necessary parameters, including the API key, user identifier, type, and end-to-end ID. Additionally, define the
onFinish
andonClose
callback functions to handle the corresponding events received from the WebView.
GoSaffeCapture(
captureKey: '', // capture key (sandbox or production)
user: '', // end-user identifier (either email or CPF)
type: '', // 'onboarding' or 'verification'
endToEndId: '', // identifier to keep consistency between front and backend
onFinish: () {
// Do something when the finish event is received
print('Finish event received');
},
onClose: () {
// Do something when the close event is received
print('Close event received');
},
onError: () {
// Do something when the return some error on rendering screen
print('Error received');
}
),
- Add the GoSaffeCapture widget where you want it to be displayed in your user interface.
Scaffold(
appBar: AppBar(
title: Text('Example of GoSaffeCapture'),
),
body: Center(
child: GoSaffeCapture(
captureKey: 'your_api_key',
user: 'user_identifier',
type: 'verification | onboarding',
endToEndId: 'end_to_end_id',
onFinish: () {
// Do something when the finish event is received
print('Finish event received');
},
onClose: () {
// Do something when the close event is received
print('Close event received');
},
onError: () {
// Do something when the return some error on rendering screen
print('Error received');
}
),
),
),
Make sure to replace captureKey
, user
and endToEndId
with the actual values needed.
Support #
If you have any questions or encounter any issues, feel free to open an issue in this repository.