FAQ Database Discussion Community


Does the dart VM impose restrictions on the stack memory size of a native extension?

c,memory,dart,dart-native-extension
I'm learning to write a native extension and I noticed an odd occurrence. When I allocate a multidimensional array and access it like so: (excuse any messy C code and bad practices I might be using unless they're likely the cause of my error. My C is not-so-great) int table[rows][cols];...

How to add data to a synchronous broadcast StreamController from inside an event listener to that controller's Stream?

dart,dart-async
In the documentation for StreamController.broadcast(): The controller distributes any events to all currently subscribed listeners at the time when [add], [addError] or [close] is called. It is not allowed to call add, addError, or close before a previous call has returned I understand the need for this limitation (at least,...

Can I have two apps in one webpage in Dart + polymer?

dart,dart-polymer
I have a dart + polymer app, which I have uploaded to my home page. The entry point is not index.html. It works fine. I have now developed a home page, index.html, again in polymer and dart. Essentially, it's another app of course. It's n the same top level folder...

Intercept dialog from and read the contents

webview,dialog,dart,google-chrome-app
I use this code to intercept a dialog from a webview but I can not see the content or interact with it: Element webview= querySelector("#webview"); Map<String,String> map=new Map(); map["src"]=urlWebView+user; webview.attributes.addAll(map); querySelector("#webview_cont").style.visibility="visible"; window.addEventListener("dialog",(Event e){ //Use window or webview returns the same result e.preventDefault(); ... //What should I do here ?? }...

Google Cloud Messaging in dart

dart,google-chrome-app,chromium,chrome-gcm
I'm trying to connect to the Google Cloud Messaging with this code in dart senderIds.add("api-project-testid"); chrome.gcm.register(senderIds).then(registerCallback); but I have this error: Exception: Uncaught Error: Profile was not signed in. I think that the error arises from the fact that chromium is not connected with any account. Does anyone know how...

Retrieving the selected item in a paper-element dropdown

dart,dart-polymer,paper-elements
I have the following code following the examples at https://github.com/dart-lang/polymer-core-and-paper-examples/blob/master/web/paper_dropdown.html and https://github.com/dart-lang/polymer-core-and-paper-examples/blob/master/web/paper_dropdown.dart EDITED .html <paper-dropdown-menu label='Click to select..' on-core-select='{{onCoreSelectCountryHandler}}'> <paper-dropdown class='dropdown'> <core-menu id='country' class='menu'> <template repeat='{{country in countries}}'>...

How to develop a Dart library locally?

dart,dart-pub
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 to install a...

Dart data binding from a parent custom element to attributes of a child custom element

dart,dart-polymer
Here is a problem that cropped up today when I updated to the latest Dart libs. The child custom element is a combo box. The parent custom element fills it with a varying list of strings. // child HTML <polymer-element name="bx-icombo" attributes="aLabel aList aSelected"> <template> <div class='outr' flex layout horizontal...

Type Error when using JwtSessionHandler - dart

types,dart,jwt
I have a problem with the dart types when using the JwtSessionHandler. I wanted to integrate user authentication and sessions using this example application from the shelf_auth git repository as a guide. Unfortunately I get an error when running the application (no syntax errors are detected before running the application)...

PercentCompleteEditor allows values > 100 in bwu_datagrid

dart,bwu-datagrid
PercentCompleteEditor allows to enter values > 100 and < 0 without any error/warning in bwu_datagrid.

Cross-Domain issue in Chrome possibly b/c of strange Dart HttpRequest behavior

ajax,google-chrome,amazon-s3,dart,cors
I know guys, there are tons of questions about the Amazon S3 Buckets and CORS. But please, let me add mine. So I'm writing an application in Dart and I am performing an ajax request to a resource which is hosted on S3. I originally wanted to grab the first...

How can a “missing concrete implementation” warning be suppressed?

dart,warnings
What can I do to prevent the compiler from throwing the following warning Missing concrete implementation of setter 'MyClass.field' and getter 'MyClass.field' on the following code? import 'package:mock/mock.dart'; class MyClass { String field; } @proxy class MockMyClass extends Mock implements MyClass{} ...

How to receive data from an Iframe in Dart?

iframe,dart,postmessage
I know that the only way to communicate with an iframe is using the postMessage method as follow: iframe.contentWindow.postMessage("my message", window.location.href); but I would like to know how to receive data from the iframe after any change on it....

inserting value of map to string

dart
I took a look at the postgresql driver dokumentation. I found the following code there. conn.query('select color from crayons where id = @id', {'id': 5}) .toList() .then((result) { print(result); }); conn.execute('insert into crayons values (@id, @color)', {'id': 1, 'color': 'pink'}) .then((_) { print('done.'); }); I wanted to test the inserting...

Dart Pub greater than and less then mardown issue

dart,markdown,publish
Having an issue with the display of "<" and ">" using markdown's back-tick code syntax in Dart pub? Not sure how to achieve: Future<bool>. If I write that as I have done here, it comes out as: Future&lt;bool&gt;, as found here: https://pub.dartlang.org/packages/functional_behaviour_tree Have also noticed that where packages were fine...

Weird DartEditor behavior / bug?

dart,dart-editor
I'm working on a little website using dart. I have one project for the server, and another for the client app (see picture below) In the server app I serve the client app from the client project like this runServer() { var staticHandler = createStaticHandler(r"C:\Users\Lukasz\dart\linkShepherdClient\web\", defaultDocument: 'linkShepherd.html',serveFilesOutsidePath: true); var handler...

How to migrate to Polymer and PaperElements 1.0 using pubspec.yaml

dart,dart-polymer,paper-elements
I have found Migration guide (https://www.polymer-project.org/1.0/docs/migration.html). My Dart project does not use bower but pubspec.yaml and when I changed dependencies version for PaperElements I get message: paper_elements has no versions that match >=1.0.0 environment: sdk: '>=0.8.10+6 <2.0.0' dependencies: browser: '>=0.10.0+2' code_transformers: any core_elements: '>=0.6.0' dnd: any logging: '>=0.9.3' paper_elements: '>=1.0.0'...

Error 42601 using postgresql and dart

postgresql,dart
I get the error 42601 when using postgresql I created the table using pgAdmin. The autogenerated code looks as follows. -- Table: posts -- DROP TABLE posts; CREATE TABLE posts ( post_id bigserial NOT NULL, title character varying(150) NOT NULL, description character varying(500), posted_at timestamp with time zone, last_edited timestamp...

Does Polymer Dart have something similar to Angular's ng-switch?

dart,switch-statement,polymer
Is there something in Polymer to do a switch statement in markup? I have this component I want to build, and it could have a ton of "IFs" to simply display some code. I was wondering if Polymer has something like Angular's ng-switch? Example: <div ng-switch="selection"> <div ng-switch-when="settings">Settings Div</div> <div...

Set custom header in Dart's HttpRequest

dart,httprequest
I need to set a custom header in my HttpRequest in order to use encryption in an S3 bucket. The header which I want to set the header x-amz-server-side​-encryption​-customer-algorithm but I always get an SyntaxError: An invalid or illegal string was specified. 'x-amz-server-side​-encryption​-customer-algorithm' is not a valid HTTP header field...

Is it possible to change the default build directory in Dart?

dart
When I run pub build, pub puts the compiled app into build/web. Is it possible to configure my pubspec.yaml file to change the default output directory to, say, prod? EDIT: I'm trying to avoid having to use the --output switch each time....

Dart import package:polymer/polymer.dart error

dart,dart-polymer,dart-pub
I'm trying to create my own element with Polymer, but i can't import polymer package. Why it throws error: "Target of URI doesn't exist"? In Tools Output window I found 404 error. And my pubspec.yaml: name: polymer1 description: A sample web application dependencies: browser: any polymer: ">=0.15.1 < 0.17.0" ...

Different server behavior from CURL and browser

session,curl,dart
My server behaves differently when I do a login request with CURL and from the browser. When doing the following curl request: curl -i -X POST 'http://localhost:8080/login' -d 'username=fred&password=blah' -H 'content-type: application/x-www-form-urlencoded' I get the expected result in form of: However when doing the same (or so I think) request...

How to sort map value?

dart
I have this map: var temp= { 'A' : 3, 'B' : 1, 'C' : 2 }; How to sort the values of the map (descending). I know, I can use temp.values.toList()..sort(). But I want to sort in context of the keys like this: var temp= { 'B' : 1,...

Dart Mirrors in JS: type '_ListConstructorSentinel' is not a subtype of type 'int'

dart,dart-mirrors,dart2js,dart-sdk
The following code executes fine on the VM, but fails with "'_ListConstructorSentinel' is not a subtype of type 'int'" when converted to javascript via Dart2JS. I'm using "pub run test -p chrome " to run the code. import "dart:mirrors"; main() { TypeMirror tm = new TypeToken<List<String>>().typeMirror; (tm as ClassMirror).newInstance(const Symbol(""),...

Dart, NoSuchMethodError: method not found: 'options' when using CommandRunner

dart,command
Using the example here: http://www.dartdocs.org/documentation/args/0.13.0/index.html I'm trying to write a command line app, but I get NoSuchMethodError: method not found: 'options' when I try to use this example code. Why isn't options defined for the Command subclass instance? If I'm not supposed to use options then what am I supposed...

On which version is based Polymer Dart?

dart,polymer,dart-polymer
What the version Dart Polymer use (of the original Polymer project, eg 0.5 or 0.8 etc)? And where can I see it? I mean on which version Polymer.dart is based concerning the mainstream Polymer.js. For example recently Polymer (JS version) released 0.8 version with some breaking changes and features. I...

compiled dart code not running in IE 10 and IE 11

dart,internet-explorer-10,internet-explorer-11,dart2js
I am having trouble with a small dart app which runs perfectly fine in Chrome and Firefox and... guess what.... not in IE 10 and 11 (Project Spartan in Win10 Preview works!). It is a simple UI controll logic like so: ... //init elements SelectElement studyList = querySelector('#studies'); SelectElement roleList...

How to set callback when