bloom_share_kit 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 41

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 #

NameDescriptionType
actionAction typeAction
tokenUnique string to identify this data requeststring
urlThe API endpoint to POST the ResponseData to.<br/> See below for detailsstring
org_logo_urlA url of the logo to display to the user when requesting datastring
org_nameThe name of the organization requesting datastring
typesThe type of attestions required and the amount neededAttestationTypeID
org_usage_policy_urlThe url of the usage policy for the organization requesting datastring
org_privacy_policy_urlThe url of the privacy policy for the organization requesting datastring

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

1.0.0 #

  • Initial Release

example/README.md

Share Kit Flutter Story Book #

Story book of Share Kit Flutter.

Check lib/stories to see the usage of Share Kit Flutter.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  bloom_share_kit: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bloom_share_kit/bloom_share_kit.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
41
Learn more about scoring.

We analyzed this package on Nov 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.59 points)

71 out of 72 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/types.dart. (-3.93 points)

Analysis of lib/src/types.dart reported 8 hints, including:

line 20 col 10: Name non-constant identifiers using lowerCamelCase.

line 21 col 10: Name non-constant identifiers using lowerCamelCase.

line 22 col 10: Name non-constant identifiers using lowerCamelCase.

line 23 col 10: Name non-constant identifiers using lowerCamelCase.

line 30 col 12: Name non-constant identifiers using lowerCamelCase.

Fix lib/src/attestations_lib/rfc3339_date_time.dart. (-1.49 points)

Analysis of lib/src/attestations_lib/rfc3339_date_time.dart reported 3 hints:

line 45 col 16: Name non-constant identifiers using lowerCamelCase.

line 74 col 16: Name non-constant identifiers using lowerCamelCase.

line 122 col 16: Name non-constant identifiers using lowerCamelCase.

Fix lib/src/elements/request_button.dart. (-1 points)

Analysis of lib/src/elements/request_button.dart reported 2 hints:

line 40 col 11: Await only futures.

line 97 col 5: Await only futures.

Fix additional 6 files with analysis or formatting issues. (-2 points)

Additional issues in the following files:

  • lib/src/elements/utils.dart (2 hints)
  • lib/src/attestations_lib/attestation_types.dart (1 hint)
  • lib/src/attestations_lib/hashing_logic_types.dart (1 hint)
  • lib/src/attestations_lib/hashing_logic.dart (Run flutter format to format lib/src/attestations_lib/hashing_logic.dart.)
  • lib/src/elements/request_qr_code.dart (Run flutter format to format lib/src/elements/request_qr_code.dart.)
  • lib/src/types.g.dart (Run flutter format to format lib/src/types.g.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-30 points)

The version constraint in pubspec.yaml does not support the latest published versions for 3 dependencies (flutter_svg, json_annotation, json_serializable).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
buffer ^1.0.6 1.0.6
collection ^1.14.11 1.14.11 1.14.12
convert ^2.1.1 2.1.1
ethereum_util ^1.2.0 1.2.0 1.3.0
flutter 0.0.0
flutter_svg ^0.12.4 0.12.4+1 0.15.0
json_annotation ^2.0.0 2.3.0 3.0.0
json_serializable ^2.0.0 2.3.0 3.2.3
merkletree ^1.0.3 1.0.3
meta ^1.1.6 1.1.7 1.1.8
qr ^1.1.1 1.2.0
sortedmap ^0.4.2 0.4.2
url_launcher ^5.0.2 5.2.5
Transitive dependencies
analyzer 0.36.4 0.39.1
args 1.5.2
async 2.4.0
build 1.2.2
build_config 0.4.1+1
charcode 1.1.2
checked_yaml 1.0.2
cli_repl 0.2.0+1
colorize 2.0.0
crypto 2.1.3
csslib 0.16.1
dart2_constant 1.0.2+dart2
dart_style 1.2.9 1.3.3
equatable 0.2.6 1.0.0
fluri 1.2.8
front_end 0.1.19 0.1.29
glob 1.2.0
html 0.14.0+3
http 0.12.0+2
http_parser 3.1.3
intl 0.15.8 0.16.0
js 0.6.1+1
json_schema 2.2.1
kernel 0.3.19 0.3.29
logging 0.11.3+2
matcher 0.12.6
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
package_resolver 1.0.10
path 1.6.4
path_drawing 0.4.1
path_parsing 0.1.4
petitparser 2.4.0
pointycastle 1.0.2
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.1.2+1
sass 1.23.3 1.23.7
sky_engine 0.0.99
sockjs_client 0.3.5
sockjs_client_wrapper 1.0.14
source_gen 0.9.4+4 0.9.4+6
source_maps 0.10.8
source_span 1.5.5
stack_trace 1.9.3
stream_transform 0.0.19 1.0.0
string_scanner 1.0.5
term_glyph 1.1.0
tuple 1.0.3
typed_data 1.1.6
uri 0.11.3+1
url_launcher_platform_interface 1.0.1
utf 0.9.0+5
vector_math 2.0.8
w_common 1.20.1
w_transport 3.2.8
watcher 0.9.7+12
xml 3.5.0
yaml 2.2.0
Dev dependencies
build_runner ^1.3.0
flutter_test
mockito ^4.0.0
pedantic ^1.5.0 1.8.0+1
storyboard ^0.0.4
test ^1.5.0