FAQ Database Discussion Community


“Refused to load the image” in a Chrome App

dart,google-chrome-app,content-security-policy
I have this problem in dart Refused to load the image 'https://**.png' because it violates the following Content Security Policy directive: "img-src 'self' data: chrome-extension-resource:". when try to set src in image element ImageButtonInputElement button = new ImageButtonInputElement(); button.className="button_element"; button.src=el["imageUrl"]; //like "https://**.png" whit this manifest.json "content_security_policy":"img-src https://server.example.org" Someone would know...

How do I programatically select and disable a PaperButton?

dart,dart-polymer
I'm trying to migrate from Bootstrap to Polymer/Paper and I've got a lot of situations where I have to enable/disable buttons that were previously accessed as ButtonElements and then .disabled=true/false. So for example I've got a paper button I'm trying to access and enable/disable via querySelector as such: PaperButton nextWeekButton...

How to remove diacritics (accents) from a string?

string,dart,diacritics,unaccent
I'm trying to convert some strings that are in Czech, Spanish, French etc. I'd like to take out the accent marks in the letters while keeping the letter. (E.g. convert é to e, č to c, Ž to Z, ñ to n) What is the best way to achieve this?...

How can I tell the dartanalyzer what kind of Element the selected object is?

object,syntax,types,dart
I have the code if(querySelector('#username').value!="") and it is working. But Darteditor warns me, that the getter 'value' is not defined for the class 'Element'. I know, that what the querySelector returns is an InputElement and therefore, my question is only for reasons of beauty and to remove the warnings. How...

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 ?? }...

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...

Error 42703 when connecting to postgresql database with dart

postgresql,dart
To test my connection to the database I wanted to simply add some hard coded data to one table. Here is my approach. In the main.dart file there are only 2 problem related rows DatabaseUtility dbUtil = new DatabaseUtility('postgres', 'kewoziwa', 'auctionDB'); dbUtil.insertIntoUsers({'login': 'dartUser', 'password': 'passMePlease'}); In the first row I...

dart wait for inner Future

mysql,dart
I'm trying to execute some queries which have a reference as foreign keys on each other, so I have to wait until the outer future is finished. This algorithm is placed inside a function which returns a future. Future<List<int>> newEntry(Session session) { bool success = true; List<int> error = Helpers.formatJsonAndEncodeUtf8(...

Polymer - paper-input floating label color

html,css,dart,dart-polymer,paper-elements
How can i change color of focused floating label in polymer? Thanks for answers....

Block until field is initalized

dart
trying to block the execution within a setter until the filed value changes and i know that it will change within a few microseconds, to demonstrate the problem i wrote: import 'dart:async'; void main() { new Timer.periodic(new Duration(seconds:1),(t)=>print(Store.x)); new Timer.periodic(new Duration(seconds:3),(t)=>Store.x='initalized'); } class Store{ static String _x = null; static...

does exist a Dart plugin for Netbeans?

netbeans,dart,netbeans-8
The only information about creating a dart plugin from netbeans is this one: https://blogs.oracle.com/geertjan/entry/dart_and_netbeans_ide_7 Was this plugin ever created? where is the Soruce Code? Is there any other plan to integrate Dart to Netbeans?...

How to set callback when