w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » DART » Page 1
How to make pub build show warnings/hints from all packages
It seems no such option is available. With http://dartbug.com/9512 generating warnings for dependencies were suppressed but no exception for path dependencies (see codereview link in the linked issue).

Categories : Dart

Input time with format 24H in Dart
This is a browser limitation and has nothing to do with Dart. Seems there are several browsers which don't support the <input type="time"> at all see http://caniuse.com/#feat=input-datetime. See also html5 time inputs shows 12 hours HTML5 changing <input type="time"> to 24hrs. format? it is possible This page provides alternatives http://davidwalsh.name/html5-input-ty

Categories : Dart

why main() return value does not set exitcode in dart?
My understanding for this is that while main() may finish executing, you might have other asynchronous work going on that hasn't completed yet. You can use exit from the dart:io lib to return a exit code immediately. import 'dart:io'; main(){ exit(42); } More info from the API docs about exit: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:io#id_exit

Categories : Dart

"No such file or directory" when running cross compiled dart runtime
Not really an answer but I've found that using the last release of Raspbian (Debian Wheezy 2014-09-09) the executable works fine. So I think the cause is something old in my current Raspbian installation (I've updated it with the last updates but it is not sufficient).

Categories : Dart

Dart Language: receive a file from a POST and print its contents on the server
You are appending the filename instead of the Blob (File) to your FormData object. In Dart it looks like there is a special function for appending blobs called appendBlob(name, blob, [filename]).

Categories : Dart

Accessing library internal fields with mirror
The behavior is not guaranteed. If you were in the same library you could probably build the symbol yourself (either with #_forceAccum or with const Symbol("_forceAccum") or new Symbol("_forceAccum")). The best way to get to the symbol from outside its library is probably to find it (testing with toString() and then cache it.

Categories : Dart

Dart SDK build failed on Raspberry Pi
As explained in this comment the direct compilation in the Raspbian env is currently not tested or supported.

Categories : Dart

Polymer Paper Menu not displaying properly over Data Grid / Table
Set the BWU DataGrid's cells z-index to a value greater than 1, but less than the z-index of the actual paper menu (which has a default of 12). cr-table /deep/ div.bwu-datagrid-cell { z-index: 2; }

Categories : Dart

Dart Polymer core-selector multiple selection binding to selected not working
Here a workaround: void ready() { $["selector"].selected = selected; } Where selected is the list used to keep the selected items and selector the core-selector id.

Categories : Dart

How to get the selected text or the inner html in Dart
src.innerHtml` or `src.text print(window.getSelection().getRangeAt(0).cloneContents().innerHtml); print(window.getSelection().getRangeAt(0).cloneContents().text); There is also a shadowRoot.getSelection() in PolymerElement. print(shadowRoot.getSelection().getRangeAt(0).cloneContents().innerHtml); print(shadowRoot.getSelection().getRangeAt(0).cloneContents().text); I tried it with content

Categories : Dart

How to pass a callback function to a StreamController
You should not add the parens () class { StreamController _controller = new StreamController(onListen: _onListen, onPause: _onPause, onResume: _onResume, onCancel: _onCancel); Stream get stream => _controller.stream; } This way the expression you pass as argument to onListen, onPause, ... is a reference to a method/function. When you add parents the expression is a

Categories : Dart

Logic inside List.map
Of course you can. What is missing is a return statement. With the short function format (=>) return is implicit and the result of the expression gets returned. If you use the function block format you have to explicitly return the value you want to have in the result. Without an explicit return null is returned. List projects = urls.map((url) { if (url.indexOf("?") == -1) { return u

Categories : Dart

why am I getting type error on polymer.dart element?
initPolymer is not enough, you should pass a closure to initPolymer.run(() => ...) which executes your Polymer related code. See how to implement a main function in polymer apps for more details = Polymer 0.16.0 // main.dart: void main{ initPolymer().then((zone) => zone.run(() { var view = new ChatAppConsumer(); })); } < Polymer 0.16.0 //

Categories : Dart

dart client side hide/obfuscate code
When you run pub build from command line default is tree-shaking and minification. (When you run it from within DartEditor tree-shaking and minification is disabled. I think minification and tree-shaking is pretty close to obfuscation but obfuscation wasn't the goal, just to reduce the file size the client needs to download. Tree-shaking removes code that isn't actually called anywhere and minifi

Categories : Dart

How to install Dart in Google Compute Engine (GCE)?
This is mostly about Dart on AppEngine: You should be able to find all information here https://www.dartlang.org/cloud/ I did it using the instructions from this page and the linked pages at the bottom. The discussions here https://groups.google.com/a/dartlang.org/forum/#!forum/cloud provide some useful bits too. Dart on Compute engine: Here is a blog post that covers it pretty good http://fin

Categories : Dart

Using Bootjack CSS in child Polymer elements
You can configure the Polymer transformer to not inline the CSS files then the warnings go away. Example from another question: transformers: - polymer: inline_stylesheets: lib/bootstrap/css/bootstrap.min.css: false lib/css/op.css: false lib/font-awesome-4.2.0/css/font-awesome.min.css: false As far as I know bootjack doesn't provide shadow DOM support therefore there is n

Categories : Dart

dart url parameters get corrupted
You can use a raw string by prefixing the string with r: Uri url = new Uri.http("localhost:8090", "/browseDirectories",{"path":r"logfastdmo.localhost.log"}); which will result in the following URL: http://localhost:8090/browseDirectories?path=%5Clog%5Cfastdmo.localhost.log Alternatively, you can use a second backslash to escape the backslash: Uri url = new Uri.http("localhost:8090", "/brows

Categories : Dart

Wait for future to complete
You're not actually returning a Future in geturl currently. You have to actually return the Futures that you use: Future geturl() { return connect(db).then((conn) { return conn.query("select trim(url) from crawler.crawls where content IS NULL").toList() .then((result) { return result[0].toString(); }) .catchError((err) => print('Query error: $err')) .whenComplete(() {

Categories : Dart

How to insert elements in DART Polymer template based on object property condition?
Here's the fixed code <template repeat="{{invioMailDTO in inviiMailDTOList}}"> <template if="{{invioMailDTO.isEditable}}"> <input type="text" value="AAAAA" /> </template> <template if="{{!invioMailDTO.isEditable}}"> <paper-item icon="mail" label="{{invioMailDTO.email}}"> <paper-button affirmative data-arg="{{invioMailDTO.email}}"

Categories : Dart

How can I get a reference to the changed element using *Changed?
If you add an ID to the <textarea>, you can access it from within your class like so: $['my-textarea'] With that reference, you can access any textarea property you want.

Categories : Dart

Polymer.Dart linter gives warnings about ng-view tags used by Angular.Dart
I think there aren't many good options to handle this. I didn't know Polymer checks this because it is perfectly valid to have a custom tag without it being a Polymer element (as in your example). you can ignore the warning disable Polymer linter - polymer: lint: false see also http://dartbug.com/21237#c5 create a bug report at http://dartbug.com

Categories : Dart

XML parsing error in Dart
You never assign anything to logindata, which is what gets passed to connectChat and then on to getValue as the second argument; which is why string comes through as null, and the indexOf call throws a null ref error. Unrelated; but important; if you're going to build XML with strings like this: '<v p="' + pass + '" n="' + username + '" />' You should correctly escape quotes and encode t

Categories : Dart

Some explanations about completer
I'm not entirely sure what your intention with the code is but I think you should either Example ex = new Example(); for (var i = 0 ; i < 3 ; i++) { // create a new Example() for each iteration here ex.start().then((nbr) { // or ensure that the next iteration is not executed print(nbr); // before the previous is completed. }); } with this code ex.start() i

Categories : Dart

Is Dart mirror behavior to not allow invocation of private methods from other libraries guaranteed and part of the spec?
Reflection allows you to overcome all privacy mechanisms. So no, you can not rely on it. Think of "_foo" as "foo" prefixed by a library-token that users cannot generate. As such, #_bar in the main-library is different from #_bar in the lib library. However, you could just enumerate all identifiers of the given foo object and find the private function. If you need real privacy you need to use isol

Categories : Dart

Executing bundle of functions by their metadata tag in Dart lang
@MirrorsUsed(metaTargets: Tag) import 'dart:mirrors'; class Tag { final Symbol name; const Tag(this.name); } List getMirrorsByTag(Symbol name) { List res = new List(); MirrorSystem ms = currentMirrorSystem(); ms.libraries.forEach((u, lm) { lm.declarations.forEach((s, dm) { dm.metadata.forEach((im) { if ((im.reflectee is Tag) && im.reflectee.name == name) {

Categories : Dart

Get AST of dart source code
Yes, and this is roughly what try.dartlang.org does. I say roughly, because it doesn't interpret it, it runs the whole dart2js compiler in the browser. So you could do this, get the AST and interpret that. You could also use the Analyzer package to get the AST instead. The analyzer's representation has tended to be more stable than the dart2js internal one, and is easier to rely on because you ca

Categories : Dart

PolymerDart custom element with two-way binding to Angular.dart model
I don't know details about how binding between Angular.dart and Polymer.dart works but I suggest you try //@published @PublishedProperty(reflect: true) var data = 1; this way the DOM attribute gets updated too.

Categories : Dart

Dart Editor PUB Package Manager cannot find path.dart
Can you please add the content of your pubspec.yaml file to your question. path.dart is not a valid package name, the name of the package is only path. When you want to use a library of the path package you import package:path/path.dart though but in pubspec.yaml you reference the package name which doesn't have a .dart extension.

Categories : Dart

How to get element assoicated to onClick event
e.target should you give the element that created the event. If you set a breakpoint in DartEditor the code execution halts on the line with the breakpoint and you can investigate the properties of the e instance.

Categories : Dart

custom annotation / Metadata in dart lang
Something like import 'dart:mirrors'; import 'do_something.dart'; import 'todo.dart'; void main() { currentMirrorSystem().libraries.forEach((uri, lib) { //print('lib: ${uri}'); lib.declarations.forEach((s, decl) { //print('decl: ${s}'); decl.metadata.where((m) => m.reflectee is Todo).forEach((m) { var anno = m.reflectee as Todo; if(decl is MethodMirror

Categories : Dart

Registering custom element in Dart lang
@initMethod is a Polymer annotation and you can only use it if you use Polymer and I assume you do not. If you move the registerElement away from main you have it to put to a function or method which is called directly or indirectly from main.

Categories : Dart

Creating and displaying a simple core-list
I think your main problem is that your void onReady should look like: @override void ready() { ... } Your template element inside of <core-list-dart/> should look like: <template> <div>{{ model.first }}</div> </template> This might due to the copy/paste to StackOverflow, but you shouldn't have any spaces in the middle of your attribute declarations (for ex

Categories : Dart

Clipping of paper-dropdown-menu when placed in paper-shadow with div target
Seems to be this issue https://github.com/Polymer/paper-dropdown-menu/issues/26 which was fixed recently. In the next release, you can use the layered property in paper-dropdown for this use case.

Categories : Dart

2 same content arrays are not equal in Dart?
arr1 and arr2 are different instances of an object of type List. By default different instances are always different. When a class implements a custom == operator it can override this behavior. Some classes have a custom implementation by default like int and String. This can easily be done for immutable objects but not for mutable. One reason is that usually the hashCode is calculated from the va

Categories : Dart

Migrating from AngularDart 0.14.0 to 1.0.0
I have been in the same situation like you, and I have to admit that documentation about "how to do it properly in angular V1" is lacking. So actually, the best way I found is to use a global controller main.dart @Injectable() // don't forget that class GlobalController { final Logger log = new Logger("GlobalController"); AdminPage ctrl; OtherCtrl otherCtrl GlobalController() { c

Categories : Dart

Module.DEFAULT_REFLECTOR not initialized
It appears that the "web" folder MUST be in the same folder as your pubspec.yaml. I placed the web folder inside a folder "client", which caused the problem. Putting the web folder in the project root folder again fixed the issue.

Categories : Dart

How to use angular.dart 1.0? (dependency not working)
Your downloaded angular seems broken. You should try to repair your cache with pub cache repair (See pub cache)

Categories : Dart

Setting a bool published attribute with @published
Typically, boolean attributes work based on whether they're present or not present. So if you set up the property in your class like so: @PublishedProperty(reflect: true) bool isVisible = true; Then you can use it in the HTML like this: <description-form label = 'Others' isVisible data-receiver = 'shared| description-form --> dynamic-chkbx'> </description-form>

Categories : Dart

How to reference child component from its parent in AngularDart in AD 1.0.0
OK it turns out that the issue was more around the Scope being injected and also the fact that "Controllers" are now "Components", which means you have to set the templateUrl, or template html to render the content. Simply replacing Controller with a Component wont work you need to shift all the html code to a template file.

Categories : Dart




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.