google/webcrypto.dart

Can't use in a Dart web environment only.

Closed this issue · 1 comments

Hi, I'm currently trying to use this package in a webdev environment.

I'm facing the issue where I can't do dart pub get or any webdev command because I don't have a flutter dependency.

Would there be a way for me to use this in a web only environment without having to depend on flutter specifically?

I'm thinking the web part could be separated in its own package and this package (webcrypto.dart) could depend on the web only package to conditionally export web stuff when needed?

Just to add more details, here's the kind of error I get when interacting with dart pub in a non-flutter context, while depending this package

λ ~/dart/web_crypto_poc/ webdev serve 
Unhandled exception:
ProcessException: ***OUT***

***ERR***
The Flutter SDK is not available.

***
  Command: /Users/joel/.asdf/installs/dart/2.17.6/dart-sdk/bin/dart pub deps
#0      _runPubDeps (package:webdev/src/pubspec.dart:66:5)
#1      PubspecLock.read (package:webdev/src/pubspec.dart:80:11)
#2      readPubspecLock (package:webdev/src/command/shared.dart:100:39)
#3      ServeCommand.run (package:webdev/src/command/serve_command.dart:98:29)
#4      CommandRunner.runCommand (package:args/command_runner.dart:209:27)
#5      _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:40:24)
#6      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:119:25)
#7      new Future.sync (dart:async/future.dart:301:31)
#8      CommandRunner.run (package:args/command_runner.dart:119:14)
#9      run (package:webdev/src/webdev_command_runner.dart:21:56)
#10     main (file:///Users/joel/.pub-cache/hosted/pub.dartlang.org/webdev-2.7.10/bin/webdev.dart:19:22)
#11     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

No, at the moment no... You can copy paste code, but it'd be messy to say the least.

I'm hoping to make this something that works with both flutter and dart, and have some plans but it's not anywhere near ready yet.

Closing...