cross_storage 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 19

Dart wrapper for zendesk/cross_storage #

this is wrapper for https://github.com/zendesk/cross-storage/

installation: #

add this to your dependencies

dependencies:
  cross_storage: ^1.0.0

import #

import 'package:cross_storage/cross_storage.dart';

usage #

void main() async {
  final crossStorage = CrossStorageClient('https://example.com');

  await crossStorage.connect();
  print(await crossStorage.getKey('newKey'));
}


issues #

  1. Hub part doesnt work, it would require of forking the hub.js because there is check if origin is instanceof RegExp, and dart have diffrent RegExp for js.

1.0.0 #

  • Initial version

example/main.dart

import 'package:cross_storage/cross_storage.dart';

void main() async {
  final crossStorage = CrossStorageClient('https://example.com');

  await crossStorage.connect();
  print(await crossStorage.getKey('newKey'));
}

Use this package as a library

1. Depend on it

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


dependencies:
  cross_storage: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


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

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health issues and suggestions

Fix lib/src/cross_storage_hub.dart. (-76.51 points)

Analysis of lib/src/cross_storage_hub.dart failed with 5 errors, 2 hints, including:

line 1 col 1: Undefined name 'JS' used as an annotation.

line 4 col 8: Target of URI doesn't exist: 'package:js/js.dart'.

line 6 col 1: Undefined name 'JS' used as an annotation.

line 7 col 1: Undefined name 'anonymous' used as an annotation.

line 17 col 1: Undefined name 'JS' used as an annotation.

Fix lib/src/cross_storage_client.dart. (-58.02 points)

Analysis of lib/src/cross_storage_client.dart failed with 3 errors, 1 hint:

line 1 col 1: Undefined name 'JS' used as an annotation.

line 7 col 8: Target of URI doesn't exist: 'package:js/js.dart'.

line 10 col 1: Undefined name 'JS' used as an annotation.

line 32 col 33: Unnecessary new keyword.

Document public APIs. (-1 points)

16 out of 16 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.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0-dev.7.0 <3.0.0
Dev dependencies
build_runner ^1.7.1
build_web_compilers ^2.6.3