go_saffe_flutter 0.0.3
go_saffe_flutter: ^0.0.3 copied to clipboard
Saffe capture flutter package.
GoSaffeCapture Flutter #
Installation #
To use GoSaffeCapture in your Flutter project, you need to add the dependency to your pubspec.yaml file:
dependencies:
go_saffe_flutter: ^0.0.2
After adding the dependency, run flutter pub get to install the package.
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
onFinishandonClosecallback functions to handle the corresponding events received from the WebView.
GoSaffeCapture(
apiKey: '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');
}
),
- 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(
apiKey: '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 'your_api_key', 'user' and 'end_to_end_id' with the actual values needed.
Support #
If you have any questions or encounter any issues, feel free to open an issue in this repository.