ilap/pinenacl-dart

Target of URI doesn't exist

chickahoona opened this issue · 8 comments

Hi,

First thank you very much for your lirbary. I am currently trying to test out different libraries as a replacement for flutter_sodium which was abandoned by the author. Your library checks out all the boxes that I was looking for and especially the similarity to PyNaCl which is our backend lib made me wanted to try it out. Sadly I am running into an issue. I started with SecretBox encryption, following your example and I immediatly receive this error.

image

flutter --version
Flutter 3.3.10 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 135454af32 (4 months ago) • 2022-12-15 07:36:55 -0800
Engine • revision 3316dd8728
Tools • Dart 2.18.6 • DevTools 2.15.0
dart --version   
Dart SDK version: 2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "windows_x64"

My guess would be that the exampels are outdated? Do you maybe have some updates here how to use your lib?

thanks alot!

ilap commented

Hi,

You should run dart pub get (to resolve package dependencies) first and then dart example/secretbox.dart or dart run example/secretbox.dart

Cheers,

Pal

ilap commented

Ooooh sorry, you used the examples in the README.md.
It's been refactored so the examples' includes in README.md are outdated.
Check, the updated ones in the examples/ directory.

Example, for secret box now it's using the:

import 'package:pinenacl/api.dart';
import 'package:pinenacl/x25519.dart' show SecretBox;

instead of

import 'package:pinenacl/api.dart';
import 'package:pinenacl/secret.dart' show SecretBox;

I am sorry if my issue was so missleading. The erorr says that the URI (the path as specified in the import) doesnt exist. Checking your repo you had in earlier versions (e.g. 1.5) this secret.dart

image

Yet in newer versions (I am using the latest 0.5.1) you don't have a secretBox anymore:

image

Thanks perfect!

ilap commented

Cool, I am closing the issue

I am not sure that its completed as the Readme here in the repo and the info on dart.pub contains this outdated examples. Would you accept PR that fix that? Would you accept PRs in general?

ilap commented

Yeah, no worries.

ilap commented

I am not sure that its completed as the Readme here in the repo and the info on dart.pub contains this outdated examples. Would you accept PR that fix that? Would you accept PRs in general?

Have you managed to update the outdated examples?