bloom_share_kit 1.0.0 copy "bloom_share_kit: ^1.0.0" to clipboard
bloom_share_kit: ^1.0.0 copied to clipboard

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

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
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

buffer, collection, convert, ethereum_util, flutter, flutter_svg, json_annotation, json_serializable, merkletree, meta, qr, sortedmap, url_launcher

More

Packages that depend on bloom_share_kit