I just started learning dart.
first I created an angular2-dart based project from https://angular.io/docs/dart/latest/quickstart.html and it worked properly.
now I want to add auth0-lock dart package from https://pub.dartlang.org/packages/auth0_lock, so I modified pubspec.yaml to the following:
description: Go Dart Angular2 with ZingChart Started Kit
sdk: '>=1.13.0 <2.0.0'
Error on line 15, column 3 of ../../../.pub-cache/hosted/pub.dartlang.org/auth0_lock-0.1.0/pubspec.yaml: Error loading transformer "dart_to_js_script_rewriter": package "dart_to_js_script_rewriter" is not a dependency.
I get the same error when adding
auth0_lock: ^0.1.0 to my dependencies and running
pub get. The error message says that "dart_to_js_script_rewriter" is not a dependency in the pubspec.yaml of the auth0_lock package. It looks like it's added under
dev_dependecies if you look here. Dev dependencies of any dependent packages are ignored. Pub only gets your package’s dev dependencies.
So I think this is a problem in their package.
So, what I did was I went to https://github.com/andresaraujo/auth0_lock.dart and cloned the package, added it into my own project root in a directory called
auth0_lock. And then, in my pubspec.yaml i put:
auth0_lock: path: auth0_lock
After that I can import it using