quiltt_connector 2.0.2 copy "quiltt_connector: ^2.0.2" to clipboard
quiltt_connector: ^2.0.2 copied to clipboard

A Flutter SDK for Quiltt Connector, support iOS and Android.

Quiltt Flutter SDK #

pub package

Usage #

Add quiltt_connector as a dependency in your pubspec.yaml file.

import 'package:quiltt_connector/quiltt_connector.dart';
import 'package:quiltt_connector/configuration.dart';

class _Example extends State {
  connect() {
    QuilttConnectorConfiguration config = QuilttConnectorConfiguration(
      connectorId: "<CONNECTOR_ID>",
      oauthRedirectUrl: "<YOUR_HTTPS_APP_LINK>");

    QuilttConnector quilttConnector = QuilttConnector();
    quilttConnector.authenticate(token); // Optional
    quilttConnector.connect(context,
      config,
      // Optional: event handler function
      onEvent: (event) {
      debugPrint("onEvent: ${event.eventMetadata}");
    }, onExit: (event) {
      debugPrint("onExit: ${event.eventMetadata}");
    }, onExitSuccess: (event) {
      debugPrint("onExitSuccess: ${event.eventMetadata}");
      _setConnectionId(event.eventMetadata.connectionId!);
    }, onExitAbort: (event) {
      debugPrint("onExitAbort: ${event.eventMetadata}");
    }, onExitError: (event) {
      debugPrint("onExitError: ${event.eventMetadata}");
    });
  }

  reconnect() {
    QuilttConnectorConfiguration config = QuilttConnectorConfiguration(
      connectorId: "<CONNECTOR_ID>",
      connectionId: "<CONNECTION_ID>", // To support the Reconnect Flow
      oauthRedirectUrl: "<YOUR_HTTPS_APP_LINK>");

    QuilttConnector quilttConnector = QuilttConnector();
    quilttConnector.authenticate(token); // Optional
    quilttConnector.reconnect(context,
      config,
      // Optional: event handler function
      onEvent: (event) {
      debugPrint("onEvent: ${event.eventMetadata}");
    }, onExit: (event) {
      debugPrint("onExit: ${event.eventMetadata}");
    }, onExitSuccess: (event) {
      debugPrint("onExitSuccess: ${event.eventMetadata}");
      _setConnectionId(event.eventMetadata.connectionId!);
    }, onExitAbort: (event) {
      debugPrint("onExitAbort: ${event.eventMetadata}");
    }, onExitError: (event) {
      debugPrint("onExitError: ${event.eventMetadata}");
    });
  }

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}
1
likes
140
pub points
0%
popularity

Publisher

verified publisherquiltt.io

A Flutter SDK for Quiltt Connector, support iOS and Android.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, url_launcher, webview_flutter

More

Packages that depend on quiltt_connector