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
23
votes
10 answers

Package import - Target of URI does not exists

Please check my project: https://github.com/MaximGo/WebTech_Projekt.git In the file 'tetrisclient.dart' I want to import the generated package from the lib-folder. import 'package:tetris/tetris.dart'; But I get the Erro 'Target of URI does not…
PeterP
  • 241
  • 1
  • 2
  • 3
23
votes
5 answers

How to install pub (command line usage) for Dart on Ubuntu web-server

I've followed the instructions here (under the Linux tab) on installing Dart onto a Ubuntu web-server. Dart itself works fine, but I can't use Pub commands (only Dart commands). How can I install Pub for the server?
Will Squire
  • 6,127
  • 7
  • 45
  • 57
21
votes
2 answers

What does plus one (+1) mean in dart's dependency versioning

I see this +1 in a some flutter dependencies and have been wondering what it means because i have been seeing it more often these days. Sample pubspec.yaml dependencies: flutter: sdk: flutter cloud_firestore: ^0.8.1+1 sqflite: 0.12.2+1 …
nonybrighto
  • 8,752
  • 5
  • 41
  • 55
19
votes
3 answers

Dart Packages: Dependency conflicts

In a Dart/Flutter project, I have dependencies: graphql: '^2.1.1-beta.5' flutter_bloc: ^3.0.0 as dependencies. However, graphql depends on rxdart: ^0.22.0 and flutter_bloc depends on rxdart: ^0.23.0, which give me error: Because flutter_bloc…
nigong
  • 1,727
  • 3
  • 19
  • 33
18
votes
5 answers

Error in compilation with Geolocator pluggin

I'm getting the current error when compiling a project with Geolocator pluggin: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\geolocator_android-2.0.0\android\src\main\java\com\baseflow\geolocator\location\LocationMapper.java:29: error: cannot…
18
votes
5 answers

I am getting the following error on running flutter create my_appName: "my_appName" is not a valid Dart package name

I have tried upgrading flutter to the latest version. I am still getting the same error.
18
votes
1 answer

resizeToAvoidBottomPadding isn't defined

After I update my flutter with command flutter pub upgrade, this function isn't defined anymore, any solution for this..
ComaXD EA1
  • 405
  • 5
  • 13
17
votes
2 answers

GoogleMaps widget error Unable to retrieve flag snapshot for com.google.android.libraries.consentverifier

I have the following error when entering a page with Google Maps widget W/DynamiteModule(17290): Local module descriptor class for com.google.android.gms.googlecertificates not found. I/DynamiteModule(17290): Considering local module…
TonyWyomy
  • 570
  • 5
  • 17
17
votes
2 answers

How to add a neon glow effect to an widget border / shadow?

Is there any way to create effects like these using flutter (a CustomPaint with a special shadder or something like this)? For example. I have this container and I drew some lines on it using a CustomPainter. Could I draw these lines using a neon…
alexpfx
  • 6,412
  • 12
  • 52
  • 88
15
votes
7 answers

When I try to build the APK Following shows in the debug console. Build: Build Failed with an exception

When I try to build the APK Following shows in the debug console. Build: Build Failed with an exception . Error in console…
Ahmed Ashraf
  • 281
  • 1
  • 2
  • 12
14
votes
1 answer

How do Dart Package Versions work & how should I version my Flutter Plugins?

I am wondering how Dart package versions are resolved in my Flutter application. Say, I have a dependency foo and declare a dependency like this: dependencies: foo: ^1.2.3 How does Dart Pub know what version to resolve / what happens when a new…
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
13
votes
2 answers

Dart package dependency to subdirectory of git repo

I have a couple of small dart demo projects together in one git repository. Thus each project is in a subfolder of the repository and the yaml files of each of these projects is in the corresponding folder, not under the root of the repo. Is there a…
Gregor
  • 2,917
  • 5
  • 28
  • 50
12
votes
3 answers

I migrated to null safety and i cant run "flutter pub run build_runner build" without an error being thrown

I have added // @dart=2.9 to all my files but the build_runner won't do its thing without throwing this error: Warning: Operand of null-aware operation '?.' has type 'SendPort' which excludes null. - 'SendPort' is from 'dart:isolate'. …
nnamdi
  • 131
  • 1
  • 6
12
votes
3 answers

How to develop a Dart library locally?

I might be having a mental eclipse, but it's hard for me to do the simplest thing: write a simple library and use it. (I want to do this all locally, without publishing the library, etc.) I've browsed through the list of pub commands and none seems…
Binders Lachel
  • 505
  • 1
  • 5
  • 14
12
votes
1 answer

How do I run a private pub server while still referencing packages from pub.dartlang.org?

Assuming that I'm running my own instance of pub-dartlang for a private pub feed; how do I indicate in pubspec.yaml which packages come from the private feed vs pub.dartlang.org?
Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
1
2
3
74 75