I am having trouble implementing this custom action that will launch an onboarding URL by using a generated SDK from Phyllo api. I had follow various guide on how to implement it but unable to do so. I also added pubspec dependencies as required in pub.dev guide. I am unsure what can I do to make it work, I would appreciate anyone who could help.
Here is the docs of the SDK integration of Phyllo:
https://docs.getphyllo.com/docs/api-reference/connect-SDK%2Fmobile%2Fflutter-SDK-integration
Here is the pub.dev guide: https://pub.dev/packages/phyllo_connect
Below is the code I had added into the custom action:
// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:phyllo_connect/phyllo_connect.dart';
final PhylloConnect _phylloConnect = PhylloConnect.instance;
Future launchSdk(
String? clientDisplayName,
String? userId,
String? token,
) async {
// Add your function code here!
void launchSdk(String workPlatformId) {
Map<String, dynamic> config = {
'clientDisplayName': clientDisplayName,
'environment': PhylloEnvironment.staging.name,
'userId': userId!,
'token': token!,
'workPlatformId': workPlatformId
};
_phylloConnect.initialize(config);
_phylloConnect.open();
}
}