2
votes

I have created some local libraries in my dart lib directory. These libraries are visible in dart packages for each newly created folder in the web directory. However, when I attempt to access them using the dart's package nomenclature eg package:reg/name.dart, the system always generates an error.

I think I am missing something.

I have read http://pub.dartlang.org/doc/package-layout.html but this did not help me either.

1
Please add the error you're getting, as well as a small reproducible sample. The more info we have the better we can diagnose your problem. - Juniper Belmont
Solved. I found out what to do. Thanks. - st.clair.clarke
If you have figured out the problem, please post the solution below so that everyone can use your knowledge! - Juniper Belmont

1 Answers

1
votes

You need to ensure that the name you're using as the package matches that in pubspec.yaml.

Eg. if in pubspec.yaml you havename: my_app and your file is at lib\my_library.dart then you need to use import 'package:my_app/my_library.dart';.