Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

hellobloom/share-kit-flutter

Repository files navigation

⚠️ Notice ⚠️

This library is no longer maintained.

Share Kit Flutter

Share Kit Flutter

Flutter implementation of Share Kit

Usage

Check example for complete examples.

import 'package:bloom_share_kit/bloom_share_kit.dart';

final requestData = RequestData(...)
final buttonCallbackUrl = '...'

RequestButton(
  requestData: requestData,
  buttonCallbackUrl: buttonCallbackUrl,
)

RequestData

Name Description Type
action Action type Action
token Unique string to identify this data request string
url The API endpoint to POST the ResponseData to.
See below for details
string
org_logo_url A url of the logo to display to the user when requesting data string
org_name The name of the organization requesting data string
types The type of attestions required and the amount needed AttestationTypeID
org_usage_policy_url The url of the usage policy for the organization requesting data string
org_privacy_policy_url The url of the privacy policy for the organization requesting data string

AttestationTypeID

See share-kit for a complete list of supported attestation types.

Appending to URL

The user can share by tapping a button or scanning a QR code, sometimes you'll need to know the difference so the query param share-kit-from is appended to your url.

The param will either be share-kit-from=qr OR share-kit-from=button.

// Input
'https://receive-kit.bloom.co/api/receive'

// Output
'https://receive-kit.bloom.co/api/receive?share-kit-from=qr'

Works if your url already has a query param too!

// Input
'https://receive-kit.bloom.co/api/receive?my-param=',

// Output
'https://receive-kit.bloom.co/api/receive?my-param=&share-kit-from=qr',

Button Callback URL

The buttonCallbackUrl parameter will be used to send the user back to your app after they share their data.

Example

import 'package:bloom_share_kit/bloom_share_kit.dart';

final requestData = RequestData(
  action: Action.request_attestation_data,
  token: 'a08714b92346a1bba4262ed575d23de3ff3e6b5480ad0e1c82c011bab0411fdf',
  url: 'https://receive-kit.bloom.co/api/receive',
  org_logo_url: 'https://bloom.co/images/notif/bloom-logo.png',
  org_name: 'Bloom',
  org_usage_policy_url: 'https://bloom.co/legal/terms',
  org_privacy_policy_url: 'https://bloom.co/legal/privacy',
  types: [AttestationTypeID.phone, AttestationTypeID.email],
)

RequestButton(
  requestData: requestData,
  buttonCallbackUrl: 'https://mysite.com/bloom-callback',
)

Sample Button

Response

For validating the reponse on your server see share-kit

Testing

Run

flutter test

About

↗️ Easily allow your users to share their verified personal information directly with your application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages