Skip to content

Commit f216948

Browse files
committed
Updated readme for 0.2.0 release
1 parent a24121a commit f216948

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ web browser this package wraps the [`window.crypto`][window-crypto] APIs and
1313
providing the same Dart API as the native implementation.
1414

1515
This way, `package:webcrypto` provides the same crypto API on multiple
16-
platforms. Initially targeting Flutter for **Android** and **Web**, with **iOS**
17-
and other platforms following as soon as the build system allows.
16+
platforms. Initially targeting Flutter for **Android**, **iOS** and **Web**,
17+
with other platforms following as soon as the build system allows.
1818

1919
**Example**
2020
```dart
@@ -51,6 +51,32 @@ Future<void> main() async {
5151
For a discussion of the API design of this package,
5252
see `doc/design-rationale-md`.
5353

54+
## Use with `flutter test`
55+
56+
Unlike most plugins it is possible to run code that uses `package:webcrypto`
57+
with `flutter test`. For this to work the native library must be built in the
58+
application folder where `flutter test` is called. This can be done with:
59+
60+
```bash
61+
# Only necessary when package:webcrypto is used from 'flutter test'
62+
# This is not necessary for development with 'flutter run' and hot-reload
63+
$ flutter pub run webcrypto:setup
64+
65+
# Now it's possible to run tests that uses package:webcrypto
66+
$ flutter test test/my_test_file_using_webcrypto.dart
67+
```
68+
69+
This requires:
70+
* `cmake`
71+
* a C compiler (like `gcc` or `clang`)
72+
* Linux or Mac.
73+
74+
The native library will be stored in `.dart_tool/webcrypto/` which should
75+
_not_ be under source control.
76+
77+
It is also possible to run tests with Flutter Web using
78+
`flutter test -p chrome`, this does not require any additional setup steps.
79+
5480
## Limitations
5581
This package has a few limitations compared to the
5682
[Web Cryptograph API][webcrypto-spec]. For a discussion of parity with

example/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ packages:
478478
path: ".."
479479
relative: true
480480
source: path
481-
version: "0.1.2"
481+
version: "0.2.0"
482482
webdriver:
483483
dependency: transitive
484484
description:
@@ -502,4 +502,4 @@ packages:
502502
version: "2.2.1"
503503
sdks:
504504
dart: ">=2.9.0-14.0.dev <3.0.0"
505-
flutter: ">=1.17.0"
505+
flutter: ">=1.17.0 <2.0.0"

0 commit comments

Comments
 (0)