bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
237 stars 122 forks source link

fix: remove dart:io dependency to allow compiling for web/flutter_web #53

Closed alextekartik closed 3 years ago

alextekartik commented 3 years ago

I have a build that started failing recently with the following error when using build_runner:

[WARNING] build_web_compilers:entrypoint on test/encrypt_codec_test.dart.browser_test.dart:
Skipping compiling sembast|test/encrypt_codec_test.dart.browser_test.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:

pointycastle|lib/digests/keccak.dart

https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings

I used to be able to use this very convenient library on the web.

There seems to be an extra dart:io import (unused too) that is causing an issue recently. Dart analysis also reports several other errors that might be worth looking at. Maybe adding some test in travis (dart test -p chrome / build_runner test) could also help ensuring that it works on the web.

My pull request is just about removing those unused dart.io imports.

mwcw commented 3 years ago

Hi,

Thanks for this, it has been merged.

It will sync soon.

MW

alextekartik commented 3 years ago

As of today, this is still an issue (nothing seems to have been merged), preventing using pointycastle in flutter web.