Questions tagged [dart-html]

Dart HTML allows access to basic browser features like the DOM, FileSystem, Websockets and other things.

Dart HTML provides access to basic browser features like the DOM, FileSystem, Websockets and other things. It doesn't provide the same interfaces to the DOM that JavaScript has, but provides a much richer interface to the DOM. Some browser features, like SVG, WebGL and Web Audio have their own libraries.

dart:html library

Connect Dart & HTML

474 questions
3
votes
1 answer

Dart HTML: Clear onClick listeners on Button

Is there some kind of way to clear onClick listeners on a button in Dart HTML that doesn't require keeping track of all the listeners? This code is executed each time a certain div is made visible and onClick listeners are attached to certain…
Jan Vladimir Mostert
  • 12,380
  • 15
  • 80
  • 137
3
votes
0 answers

Print PDF using Dart in the browser

I'm trying to print out a PDF I'm generating in Java using a Dart frontend. I can perfectly display the PDF in an iFrame, trigger a download on the PDF, but now I need to be able to print the PDF. This is what I've tried so far, but got stuck: This…
Jan Vladimir Mostert
  • 12,380
  • 15
  • 80
  • 137
3
votes
1 answer

Dart Element.html converts to lowercase (and should not)

A am trying to add a (with capital G) to an SVG element using Dart (dartlang.org). The result is a element (with lowercase g). Browsers (Firefox and Chromium) do not display this correctly, they require a capital G…
Hendrik Jan
  • 4,396
  • 8
  • 39
  • 75
3
votes
1 answer

Dart unit test not working with content-shell

I have dart unit tests written using test: '>=0.12.1 <0.13.0' library. When I try to run tests using Dartium it works perfectly, but using content-shell it throws error. pub run test test/unit -p content-shell Failed to start content shell: Bad…
ashokd
  • 393
  • 2
  • 11
3
votes
2 answers

dart: how to get correct (typed) reference to document object in iframe

I have a use case where a complex UI hierarchy needs to be rendered in an iframe, but the logic handling it (creation, enter document, event handling, exit document) need to be in the main frame / app. I face issues with getting a typed reference to…
Peter StJ
  • 2,297
  • 3
  • 21
  • 29
3
votes
1 answer

Why are onOpen and onClose Streams (not Futures) in dart:html WebSockets?

A dart:html.WebSocket opens once and closes once. So I'd expect that the onOpen and onClose properties would be Futures, but in reality they are Streams. Of course, I can use stream.onClose.first to get a Future. But the done property on the dart:io…
StephanS
  • 843
  • 1
  • 8
  • 20
3
votes
1 answer

Why is RenderingContext.drawElements clearing the screen before it draws?

Is RenderingContext.drawElements correct when it clears the screen before it draws? Consider these screenshots that show a step across a call to drawElements with the object already drawn being erased.
orb
  • 1,263
  • 1
  • 10
  • 16
3
votes
1 answer

Issues with Dart Intl library for translations

I am having some issues setting up translation functions for localization in my Dart application. I currently have 1 class called basics.dart, and all classes have access to its functions. Here is the function that I want…
3
votes
3 answers

Distinguish between onClick and onDoubleClick on same element to perform different actions in Dart

I want to do the ill-advised and place both an onClick and onDoubleClick on the same element with each type of event resulting in a different action. Specifically on an image, click to advance to the next image, double-click to toggle fullscreen.…
3
votes
1 answer

Dart servers refusing connection in local network

I have Dart running on Mac Mavericks and Ubuntu Linux. I am just getting started;and, none of the examples will function through my local network. When I install a server on Ubuntu and try to access with the mac- nothing happens. When I try to…
user2550943
3
votes
1 answer

How to create an ObjectStore with compond key in IndexedDB with Dart

JavaScript can use var objectStore = theDb.createObjectStore("store1", { keyPath: ["key1","key2"] }); to create ObjectStore with compound key. But how to do this in dart? Dart docs says: ObjectStore createObjectStore(String name, {String keyPath,…
ila
  • 31
  • 1
3
votes
3 answers

How to reference an image from a dart polymer component

I have a Dart polymer component referring to an image. The component is in the path component/logo-header.html