dart-editor

Turn off dart2js during pub build

匆匆过客 提交于 2019-12-11 01:28:29
问题 I am writing a custom transformer for pub build . I would like to turn off compilation of dart files to js during debugging of the transformer to save time. Is it possible? Currently, my simplified pubspec.yaml is name: my_proj dependencies: polymer: any transformers: - my_proj 回答1: There is no option for pub build only for pub serve --no-dart2js . You could temporary modify the file dart/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart in your dart install directory and set

Why only static fields can be declared as 'const'?

吃可爱长大的小学妹 提交于 2019-12-10 13:42:51
问题 I just upgraded my Dart Editor (0.5.16_r23799), and code that was bug/warning free, is not anymore. class Fubar { const BAR = 1000000; Fubar(){ } } Lines beginning by const have marker and this message : Only static fields can be declared as 'const' I read this ch02-final-const, nothing there. This post dart-const-static-fields says that const modifier implies static , if we can't use const without static , we should use final instead ?... but what doc/post I missed ? Intend to do this :

Themes for Dart Editor

本秂侑毒 提交于 2019-12-08 01:34:27
问题 Right now, the white background is killing my eyes, as it's a looong dark night. Is it possible to change the theme (to something darker) from the Dart Editor (v 0.1)? What about picking a background colour and syntax highlighting? 回答1: Yes, it is possible and I have just verified this quickfix for a darker background on the Dart Editor Version 0.1.0.201204042313 : Close the Dart Editor Open with your favorite editor the file: <DART-INSTALL-DIR>\workspace\.metadata\.plugins\org.eclipse.core

Themes for Dart Editor

蹲街弑〆低调 提交于 2019-12-06 06:39:05
Right now, the white background is killing my eyes, as it's a looong dark night. Is it possible to change the theme (to something darker) from the Dart Editor (v 0.1)? What about picking a background colour and syntax highlighting? Yes, it is possible and I have just verified this quickfix for a darker background on the Dart Editor Version 0.1.0.201204042313 : Close the Dart Editor Open with your favorite editor the file: <DART-INSTALL-DIR>\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.editors.prefs Change the content from: #Fri Apr 06 20:28:37 EST 2012 eclipse

Symbol with private identifier argument

倖福魔咒の 提交于 2019-12-04 16:19:53
I want to create a symbol equal to that of a private MethodMirror's simplename. However, Symbol's documentation states the argument of new Symbol must be a valid public identifier. If I try and create a const Symbol('_privateIdentifier') dart editor informs me that evaluation of this constant expression will throw an exception - though the program runs fine, and I am able to use it without any issues. void main(){ //error flagged in dart editor, though runs fine. const s = const Symbol('_s'); print(s); //Symbol("_s"); } It seems the mirror system uses symbols. import 'dart:mirrors'; class

How do I minify JavaScript code compiled from Dart Editor?

微笑、不失礼 提交于 2019-12-03 06:00:45
I am using Dart Editor to build a Dart app. I am compiling to JavaScript to run on all browsers. I want to minify the output JavaScript. How can I do this without dropping to the command line? I know that on the command line, I can use dart2js --minify app.dart . How do I make this automatic from Dart Editor? There are two quick and easy ways to minify your complied Javascript code through the Dart Editor. The recommended way is make a small addition to your pubspec.yaml file. Here's an example: Name: my-app description: An Angular web application dependencies: angular: any browser: any

dart: debugging client/server communication for dart client and existing rest api?

跟風遠走 提交于 2019-12-01 01:05:05
I have a rest api (developed in django/python) which i run locally and want to develop a simple client application in dart. This client uses XMLHttpRequest to communicate to a local django development server. The problem is the default run configuration in the Dart Editor launches it's own web server and than either dartium or the system browser with dart2js. Which will both obviously violate the cross origin policy when i try to access my rest api. I'm wondering what the best setup would be to test client/server communication - should i configure my rest api to proxy the :3030 port which is

Dart How to code a simple web-socket echo app

和自甴很熟 提交于 2019-11-30 23:47:27
I've been attempting to learn enough html, css, and Dart to create my first web page and all is going well, except that I do not understand how to create a simple page and a server side web-socket server that will just echo it back. The examples that I find tend to illustrate other Dart tools and either connect to echo server on the web or do other things that make their code not simple for a newbie. I've tried to simplify Seth Ladd's example "dart-example-web-sockets-client" as the 'best' example. I can receive what is sent from the page, repackage it and think i'm sending it back but

What is the difference between “show” and “as” in an import statement?

筅森魡賤 提交于 2019-11-28 05:43:45
What is the difference between show and as in an import statement? For example, what's the difference between import 'dart:convert' show JSON; and import 'package:google_maps/google_maps.dart' as GoogleMap; When do I use show and when should I use as ? If I switch to show GoogleMap all references to GoogleMap (e.g. GoogleMap.LatLng ) objects are reported as undefined. Dennis Kaselow as and show are two different concepts. With as you are giving the imported library a name. It's usually done to prevent a library from polluting your namespace if it has a lot of global functions. If you use as

Breakpoints in Dartium not working

孤者浪人 提交于 2019-11-27 05:30:37
So if I add break points in .dart files that are located in /web directory of my project, it works fine. For example I'm using AngularDart and the main.dart file works. However when I try to put a breakpoint in anything in the /lib directory, Dartium doesn't stop on them. How can I get the breakpoints in Dartium to work with the /lib directory? Note that I've tried putting breakpoints with Dart Editor, IntelliJ with Dart Plugin and also directly in Dartium and nothing works. Is this intended? Günter Zöchbauer To set breakpoints in dependencies search the source inside the (no domain) node and