Last updated:
0 purchases
fintoc
Fintoc Flutter #
Use the Fintoc widget within your Flutter application as a View.
Installation #
Install using flutter
flutter pub add fintoc
copied to clipboard
Install using dart
dart pub add fintoc
copied to clipboard
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
fintoc: ^1.0.0
copied to clipboard
Usage #
Fintoc Flutter exports a component called FintocWidgetView. This is a Flutter component that creates the same WebView from the native WebView documentation. To use the Fintoc Flutter, use the following snippet:
import 'package:fintoc/fintoc.dart';
copied to clipboard
After retrieving the FintocWidgetView component, you are ready to instantiate the widget:
final options = { ... };
final handlers = { ... };
void onSuccess(String data) {
debugPrint('onSucess from FintocWidgetView: $data');
}
void onExit(String data) {
debugPrint('onExit from FintocWidgetView: $data');
}
void onError(dynamic error) {
debugPrint('onError from FintocWidgetView: $error');
}
void onEvent(String eventName) {
debugPrint('onEvent from FintocWidgetView: $eventName');
// Event Name: opened, payment_error, closed ...etc.
}
return Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: FintocWidgetView(
options: options,
handlers: handlers,
),
),
],
);
copied to clipboard
Here, options corresponds to an object with the parameters received by the widget (you can read more about these parameters here), and onSuccess, onEvent and onExit correspond to the WebView redirections detailed here.
Acknowledgements #
This implementation was written based on the input and experience of @marialuisaclaro integrating the WebView using React Native, which served as a good starting point for the general idea of this library.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.