phyllo_connect

Creator: coderz1093

Last updated:

Add to Cart

Description:

phyllo connect

phyllo_connect #

Phyllo Connect is a quick and secure way to connect work platforms via Phyllo in your app.
Supports:
iOS, Android.
Usage #
To use this plugin, add phyllo_connect as a dependency in your pubspec.yaml file.
Example #
Replace your
import 'package:phyllo_connect/phyllo_connect.dart';

class Configs {
Configs._();

static const String clientId = '<client id here>';

static const String clientSecret = '<client secret here>';

static const PhylloEnvironment environment = PhylloEnvironment.sandbox; //set phyllo environment
}
copied to clipboard
-> Lib -> phyllo_provider.dart

import 'package:flutter/material.dart';
import 'package:phyllo_connect/phyllo_connect.dart';
import 'package:phyllo_connect_example/client/phyllo_repository.dart';
import 'package:phyllo_connect_example/constants/configs.dart';

final PhylloConnect _phylloConnect = PhylloConnect.instance;
//Too Lunch the sdk here it will method
void _launchSdk(String workPlatformId) {

Map<String, dynamic> config = {
'clientDisplayName': clientDisplayName,
'environment': PhylloEnvironment.sandbox.name,
'userId': _userId!,
'token': _token!,
'workPlatformId': workPlatformId
};

_phylloConnect.initialize(config);
_phylloConnect.open();

//Call Back from Android/iOS SDK
_phylloConnect.onConnectCallback(
onAccountConnected: (account_id, work_platform_id, user_id) {
log('onAccountConnected: $account_id, $work_platform_id, $user_id');
}, onAccountDisconnected: (account_id, work_platform_id, user_id) {
log('onAccountDisconnected: $account_id, $work_platform_id, $user_id');
}, onTokenExpired: (user_id) {
log('onTokenExpired: $user_id');
}, onExit: (reason, user_id) {
log('onExit: $reason, $user_id');
},
// [Optional callback] onConnectionFailure : User can now add a new callback connectionFailure for tracking the reason of accounts not getting connected.
onConnectionFailure: (reason, work_platform_id, user_id) {
log('onConnectionFailure: $reason, $work_platform_id, $user_id');
);

log('version: ${_phylloConnect.version()}');

}

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.