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
6
votes
3 answers

Difference between an Expression and Statement in Dart?

Since different languages have different definitions for an expression and a statement, what is the difference between them in Dart?
Shubhamhackz
  • 7,333
  • 7
  • 50
  • 71
6
votes
2 answers

How do I import a locally created package in Dart?

Say my projects' structures are as follows. contact_book <---(App)    ├── bin    │   └── contact_book.dart    ├── contact_book.iml    ├── lib    │   ├── address.dart    │   ├── email.dart    │   ├── field.dart    │   ├── functions.dart …
ThinkDigital
  • 3,189
  • 4
  • 26
  • 34
6
votes
3 answers

Dart SassBuilder cannot find Logger

I am trying to run an angular web app. I have cloned confirmed working project, but when I run pub get I get following error: /usr/lib/dart/bin/pub get Resolving dependencies... Got dependencies! Precompiling dependencies... Loading source…
Marcin Szałek
  • 4,609
  • 5
  • 30
  • 43
6
votes
1 answer

Choosing between package:html, dart:html, dart:io (class HttpClient) and package:http APIs to fetch HTTP resources

I realized that currently there are at least three "official" Dart libraries that allow me to perform a HTTP request. What is more, three of those libraries (dart:io (class HttpClient), package:http and dart:html) have each a different, incompatible…
user7610
  • 25,267
  • 15
  • 124
  • 150
6
votes
1 answer

How can I debug a custom transformer

How can I debug a (custom) transformer using the debugger in DartEditor. I tried use the transformer shown in http://dovdev.com/smoke-and-mirrors/ but it fails. I checked these documents but couldn't find anything about…
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
6
votes
1 answer

Dart to JS: How to debug the generated Javascript errors

Currently, the Javascript generated by dart2Js converter is very unintuitive to debug and doesn't produce intelligible error messages. Is there a specific way that people use to debug Javascript code generated by dart? I would like to get to the…
Ravi Teja Gudapati
  • 2,809
  • 2
  • 13
  • 16
6
votes
2 answers

How to change default port number in Dart Editor

How to change server socket port number in Dart Editor? Because local tomcat using the 8080. Seem this port changed from 3030 to 8080 after update to version 1.5.0. --- 9:41:37 AM Starting pub serve : podium --- Loading source assets...…
Roger Chan
  • 1,293
  • 2
  • 11
  • 24
6
votes
1 answer

Using Dart for Chrome Extensions

I'm trying to create a Chrome extension using Dart. As of now I can't get it to run any javascript in the extension, although I can do pub build and run it in a browser. I have the following 3 files: Manifest.json: { "manifest_version": 2, …
Mikael
  • 65
  • 1
  • 6
6
votes
1 answer

Is there a way to run Dart in Firefox for development purposes?

I know you can run Dart code natively in your browser using Dartium (Chrome with an embedded Dart VM), and you can compile your Dart to JavaScript. But seeing I prefer using Firefox for web development, is there a way to run Dart code directly in…
corgrath
  • 11,673
  • 15
  • 68
  • 99
6
votes
3 answers

How to use SASS in Dart editor

Anyone have a canned solution for integrating SASS or another CSS preprocessor into the Dart editor? Seems to require a custom build.dart, which I would rather copy than code. Thanks.
Jonathan Edwards
  • 439
  • 1
  • 3
  • 9
6
votes
6 answers

Create a package in dart

How do I create a package in the new Dart Editor? There is no "Add Pub support" checkbox? Also how to create "packages" with the new editor? Is a tutorial out there that describes the process with the new Editor?
mc_fish
  • 493
  • 3
  • 10
6
votes
2 answers

Package 'log4dart' is depended on from both sources 'hosted' and 'git'

Trying to review a tutorial from the following links: http://blog.dartwatch.com/2012/03/building-client-server-dart-app-part-1.html http://blog.dartwatch.com/2012/03/building-client-server-dart-app-part-2.html Here's my pubspec.yaml: name: …
Ed Michel
  • 898
  • 1
  • 11
  • 23
5
votes
2 answers

How can I achieve "child of a widget which is inside a scroll widget acting like sticky header" in Flutter?

I'm trying to find a way to implement a functionality in which, in a horizontally scrollable list, there are widgets that I will call P, (which are denoted as P1, P2 and P3 in the diagram) and their children C, (which are denoted as C1, C2 and C3).…
Baran S.
  • 53
  • 3
5
votes
3 answers

Negative to positive slider in Flutter

I'm trying to implement a slider for temperature, which can go from negative to positive values. I have found many examples that have sliders that go from left to right, but I have not found one which starts from middle, and goes left (negative) and…
Jaebi
  • 121
  • 1
  • 6
5
votes
1 answer

DCDG Dart Diagrams: Unhandled exception: Bad state: Unable to find the context to foldername\env.dart

I have been trying to generate dart diagrams for my code but the below error: C:\Users\Foldername\AppData\Local\Pub\Cache\bin>dart pub global run dcdg C:\Users\Foldername\AppData\Local\Pub\Cache\bin\lib Unhandled exception: Bad state: Unable to…