Questions tagged [dart-pub]

Pub is a package manager for Dart applications and libraries.

Pub is a package manager for Dart applications and libraries. You can find packages to use in a project or publish packages to the package repository. Pub automatically keeps track of dependencies to other packages and makes sure that the dependencies use the right version of a package.

Basics:

  • Use pub get to get dependencies
  • Use pub upgrade to upgrade a dependency
  • Use pub publish to make your library available for others

Resources:

1128 questions
8
votes
1 answer

In Dart with Pub, when should I use the "any" version constraint for a dependency?

When making a package, I am often confused as to whether I should use the any constraint. I know that for: library packages, I should specify clear version constraints so that users of my libraries know the version of my transitive…
Juniper Belmont
  • 3,296
  • 2
  • 18
  • 28
7
votes
2 answers

What should be ignored in Dart's .pubignore?

With the Dart 2.14 release, pub now support a .pubignore file similar to .gitignore. The docs don't seem to mention what's appropriate to include in it... are there any guidelines? My immediate thought is that I shouldn't include tests, which…
Renato
  • 12,940
  • 3
  • 54
  • 85
7
votes
1 answer

What is the official way to host dart / flutter package in enterprise (private) environment?

Since the package pub_server is discontinued. But get recommended for that use case in the README.md from pub-dev So I'm a bit confused about what is now the recommended way. I know about the package unpub but it doesn't feel right to use it in an…
swissonid
  • 1,025
  • 1
  • 10
  • 22
7
votes
2 answers

Error: The method 'getPositionStream' isn't defined for the class 'Geolocator'

Using flutter I try to retrieve the current position using StreamSubscription and getPositionStream in geo locator. But I keep getting the error: Error: The method 'getPostionStream' isn't defined for the class 'Geolocator'. Here is my…
maximus383
  • 584
  • 8
  • 25
7
votes
1 answer

How to make a Spectrogram chart in Flutter

I need to make spectrogram chart in flutter application. Let me know how we can achieve the spectrogram chart in flutter application. Here is the attached image of the chart which I need to achieve
Chinmay Mourya
  • 764
  • 5
  • 9
7
votes
2 answers

How do I find the size of a Pub package?

I am coming from the Java world to the Dart world and in Java I could easily see the size of a .jar file. Sometimes I want one functionality from a package, but if the package is too big it doesn't justifies including all that extra code into my…
Michel Feinstein
  • 13,416
  • 16
  • 91
  • 173
7
votes
1 answer

Flutter pubspec.yaml Android versionCode

My app before using Flutter had android:versionCode="17" android:versionName="17" In my Flutter application in pubspec.yaml, I have to set a version as x.y.z and I am trying set the new version to 19.0.0. But when I try to install the application…
burtsevyg
  • 3,851
  • 2
  • 29
  • 44
7
votes
2 answers

Download statistics for packages published on pub.dartlang.org?

I created a package and published it a few months ago and saw it's Popularity increased, so I was wondering is there any way to see download statistics for my package ? For example, PHP has https://packagist.org and every package has statistics like…
Dinko Pehar
  • 5,454
  • 4
  • 23
  • 57
7
votes
2 answers

The Target URI doesn't Exist:'package:firebase_database/firebase_database.dart';

Importing Dependencies in Pubsec.Yaml is successfull, But when opening main.dart file it shows the error Problem(1) The Target URI doesn't Exist: 'package:firebase_database/firebase_database.dart';
Rajesh
  • 3,562
  • 7
  • 24
  • 43
7
votes
1 answer

How can one prevent gitub repo proliferation with dart packages?

Suppose I want to create a colletion of packages, say related to cooking. I'll have a core package called cooking and then I want multiple cooking packages: cooking-mexican cooking-indian cooking-tai Each of those will use cooking. And maybe more…
user1338952
  • 3,233
  • 2
  • 27
  • 41
7
votes
2 answers

How to install an updated version of a Dart package?

When a new Dart package is published, how can I install the updated version?
Patrice Chalin
  • 15,440
  • 7
  • 33
  • 44
7
votes
1 answer

Dart project structure for apps (not libs)

I am trying to understand Dart's recommended project structure and not seeing the "forest through the trees". So, if my project is intended to be a reusable library, say, a logging framework of some sort, then if I understand the above link…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
7
votes
2 answers

dart pub fail behind a proxy - is there a way to install the packages manually?

There is a known issue with using Pub dart in a corporate network using a proxy (on windows machine at least). You cannot even run the samples as they make use of pub to get the packages. if you run the samples first from a network without a proxy,…
user2431552
  • 71
  • 2
  • 3
7
votes
1 answer

Dart pub update failed

I am getting the following error when trying to do a pub update to get the web_ui package installed. Dart Editor version : 0.2.10_r16761 Dart SDK version : 0.2.10.1_r16761 The "Help > About > Check for Update..." also gives me "Unable to get latest…
Geert
  • 239
  • 3
  • 12
6
votes
5 answers

flutter Android resource linking failed @mipmap/ic_launcher not found

FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking…
JuniorBOMB
  • 336
  • 1
  • 3
  • 11