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
5
votes
2 answers

dart pub get CERTIFICATE_VERIFY_FAILED

I recently upgraded a project from 1.22.1 to 1.24.3. Subsequently, pub get has failed with either Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345)) or Handshake…
Jacob
  • 53
  • 1
  • 5
5
votes
2 answers

Where to put Dart package assets

I am writing a Dart package, and I would like to have a resources directory that Pub includes with the package. I want this directory to be accessible relative to the root file of the package. Is there a standard way of doing this with Pub? Thanks!
Gabriel Ratener
  • 595
  • 5
  • 20
5
votes
1 answer

Dart import packages not working

Having an issue with importing packages in Dart now, the project was working yesterday but has stopped today and I have no clue why, the code hasn't changed all weekend and I don't recall running any updates. The problem exists with anything with…
trvo
  • 665
  • 1
  • 10
  • 23
5
votes
2 answers

Dart proxy requests to backend server during development

Is there an equivalent of grunt-connect-proxy for Dart / pub ? In production frontend stuff is built (pub build) as static resources and can be served by any web server (dart-agnostic). During development I'd like to communicate with the backend…
vucalur
  • 6,007
  • 3
  • 29
  • 46
5
votes
1 answer

How can I tell what mode my pub transformer is running in?

I am writing a pub transformer for Dart. I'd like the transformer to know what mode pub is run in (debug or other). Can the Transformer tell what mode it's running in? And if so, how?
Seth Ladd
  • 112,095
  • 66
  • 196
  • 279
5
votes
2 answers

How to estimate the quality of pub.dartlang.org packages?

I started a Dart project and now I need some functionality that is not available in the Dart API Reference. I was advised to use a package from pub.dartlang.org and now I am browsing through the pub. Previous experience with Javascript libraries…
Hendrik Jan
  • 4,396
  • 8
  • 39
  • 75
5
votes
2 answers

Transferring a dart library to another owner in pub.dartlang.org

Since pub uses my identity for the publish, how would I go about transferring control to someone else, yet still allow them to publish releases to the same project? Maybe this is trivial; I've never tried it.
John Evans
  • 6,858
  • 4
  • 28
  • 26
5
votes
1 answer

How to rename and or remove a pub package

How can I rename or delete packages? Currently I have a package x that I want to split into separate components. Want to keep the main Name but extend it for these components eg "x a" "x b" Current workaround would be: I keep the old one ,linking…
H.R.
  • 496
  • 4
  • 14
5
votes
2 answers

How to organize dart code inside web folder

According to the Package layout conventions the web folder should contain the following: HTML, CSS, images, and, heck, probably even some JavaScript. All of that goes into your package’s web directory. You’re free to organize the contents of that…
Marco Jakob
  • 1,068
  • 1
  • 13
  • 20
5
votes
5 answers

pub install dart-web-components failed

Running pub install on dart-web-components gives an error: Pub install fail, HttpParserException: Connection closed before full header was received /dart-web-components/build.dart --changed=packages\args\args.dart…
Juri Krainjukov
  • 732
  • 8
  • 27
4
votes
0 answers

Nothing can be built, yet a build was requested

I'm trying to store a list of objects with Hive in flutter. The ChatModel (chat_model.dart) class looks like this: import 'package:flutter/material.dart'; import 'package:hive_flutter/hive_flutter.dart'; part…
Ballazx
  • 431
  • 4
  • 12
4
votes
1 answer

What's the new location of credentials.json for dart/flutter pub

I noticed that after switching to the beta channel (Flutter 2.9.0-0.1.pre), ~/.pub-cache/credentials.json no longer exists. I was using this file to set up CI jobs to deploy my Flutter packages. Where did it go?
xip
  • 2,475
  • 3
  • 18
  • 24
4
votes
3 answers

Manually deleted package in External Libraries/Dart Packages not reappearring (Android Studio)

I manually deleted a package in External libraries/dart packages. Now I tried to run packages get again. The package(tesseract_ocr) did not appear in External libraries/dart packages. I tried removing it in pubspec.yaml and re-adding it but did not…
This123
  • 41
  • 3
4
votes
2 answers

Flutter error, Null check operator used on a null value

Whenever I tried to do register and tap on the register button then I am having this type of problem with the null check operator used on null values. I get this error message ══════ Exception caught by gesture ════════════════════ The following…
4
votes
1 answer

How to change text color according to valid(@mentions) and all hashtags?

I wanted to display hashtags and valid mentions with different colors in the text. I got helped with this code which works only for hashtags RichText _convertHashtag(String text) { List split = text.split(RegExp("#")); List
kanwar manraj
  • 492
  • 8
  • 26