0
votes

I've uploaded my package via Pub and it all seemed to work fine. The official page can be found here. The problem is, that I am unable to open this package in my sample project. I've added viltage: any to sample's pubspec.yaml and then presseed Pub Get. The output was:

Resolving dependencies...
+ viltage 0.0.1
Changed 1 dependency!

Which indicates that it all worked (again), but the viltage package wasn't in the packages folder. Then I've tried adding this line:

import 'package:viltage/viltage.dart';

to the sample's main.dart file. The file viltage.dart is present in the package. It said that the target URI does not exist and suggested: "Add dependency on package 'viltage'"

The problem I am struggeling with is that I can't use the package I've uploaded to pub.

2

2 Answers

2
votes

I saw your source on Github, you have to use the Pub Package Layout to publish a Package.

your code is a web app not a Dart package.

1
votes

Only files from the lib directory can be imported from other packages.