dart-archive / dart-samples Goto Github PK
View Code? Open in Web Editor NEWVarious samples and examples in Dart
License: Other
Various samples and examples in Dart
License: Other
And make sure they are built with dart2js :)
The problem is that onDrop sets innerHtml, but doesn't tell it to use a NodeTreeSanitizer.trusted or whitelist meta tags. As a result the whole content gets removed, which you can see in the console messages.
The link in readme to samples is WRONG - it points to github.io
The original JS samples can be found at https://github.com/Polymer/docs/tree/master/samples.
The exception "type 'double' is not a subtype of type 'int' of 'value'." is thrown on the wheel event.
The bug can be recreated by clicking the solar3d canvas and using the mouse wheel to scroll. The wheel event sends a double instead of an int. The declaration for the wheel event value has the type num.
The bug is worked around by changing the type of "accum_" variable from int to num.
change _int*
int accumDX = 0;
int accumDY = 0;
int accumScroll = 0;
to num
num accumDX = 0;
num accumDY = 0;
num accumScroll = 0;
Exception:
Breaking on exception: Class 'HtmlDocument' has no instance method 'cancelFullScreen'.
To recreate run solar3d, click the graphic, type F to enter full screen and type F again to exit full screen.
bug is fixed by changing:
void toggleFullscreen() {
if (_fullScreened) {
document.cancelFullScreen();
} else {
canvas.requestFullscreen();
}
}
to
void toggleFullscreen() {
if (_fullScreened) {
document.exitFullscreen();
} else {
canvas.requestFullscreen();
}
}
which I will submit as a pull request.
build failing on drone:
$ git clone git://github.com/dart-lang/dart-html5-samples.git /home/ubuntu/src/github.com/dart-lang/dart-html5-samples
Cloning into '/home/ubuntu/src/github.com/dart-lang/dart-html5-samples'...
$ dart --version
Dart VM version: 0.6.15.3_r25822 (Tue Aug 6 13:39:55 2013) on "linux_x64"
$ cat $DART_SDK/revision
25822
$ pub install
Resolving dependencies......................
Downloading bot 0.20.1 from hosted...
Downloading unittest 0.5.9 from hosted...
Downloading pathos 0.5.9 from hosted...
Downloading logging 0.5.9 from hosted...
Downloading bot_io 0.21.0+2 from hosted...
Downloading browser 0.5.9 from hosted...
Downloading args 0.5.9 from hosted...
Downloading meta 0.5.9 from hosted...
Downloading vector_math 1.3.0 from hosted...
Downloading hop 0.22.1+1 from hosted...
Dependencies installed!
$ dart tool/hop_runner.dart --log-level all analyze_web
Do not know how to load 'dart:crypto''package:bot_io/bot_io.dart': Error: line 4 pos 1: library handler failed
import 'dart:crypto' as crypto;
^
'package:hop/hop.dart': Error: line 7 pos 1: library handler failed
import 'package:bot_io/bot_io.dart';
^
'file:///home/ubuntu/src/github.com/dart-lang/dart-html5-samples/tool/hop_runner.dart': Error: line 5 pos 1: library handler failed
import 'package:hop/hop.dart';
^
This repo is rotting, as evidenced by dart-lang/site-www#558. We need to either test and update the examples (possibly as part of the work on dart-lang/site-www#407) or remove this repo and anything that depends on it.
Background: This repo's dart_io_mini_samples directory is the source of the examples in the cookbook (details: README). In 2017, this was the 31st most-read page on dartlang.org. https://www.dartlang.org/samples links to this page and other sources of sample code. We've removed the cookbook from the Dart 2 version of the site.
/cc @mjohnsullivan, @filiph, @chalin
The deferred loading link is broken
I've written a tutorial on how to do a Matrix effect animation that I think would go well under /web/html5/canvas.
You can see the details of it in in http://bit.ly/DartMatrixEffect.
Let me know what you think
Eric Bidelman suggested we port this section of the tutorial:
http://www.html5rocks.com/en/tutorials/file/filesystem/#toc-file-user-selected
See #93.
none of the "Live demo" links work
e.g.
https://github.com/dart-lang/dart-samples/tree/master/html5/web/video/basics
Several files in dart_io_mini_samples (and maybe elsewhere) import dart:async with the following line:
import 'dart:async'; // Import not needed but added here to explicitly assign type for clarity below.
This line wraps in our docs. (We generally use a line length of 70 for code that is displayed in dartlang.)
Please shorten this comment, or put it on a separate line.
Maybe html5/pubspec.lock, too. Also, add .pub & (if appropriate) pubspec.lock to .gitignore.
It's missing an index.html for an overview of all the samples.
One day, it'll be possible to use isolates running in separate web workers. However, even today it should be possible to use the web workers API directly.
Use the awesome "clean up" feature of Dart Editor. For example, I see "#import" statements in there.
Report from G+
See post: http://news.dartlang.org/2012/09/dart-html5-happy-web-developers.html
I am creating a WenGL application with Dart.
The code is below.
CanvasElement canvas;
WebGLRenderingContext gl;void main() {
canvas = document.getElementById("game");
gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
print("Testing");
gl.enable(RenderingContext.DEPTH_TEST);
gl.clearColor(0,0,0,1);initShaders();
initTexture();
}
However, Dartium returns this error:
Exception: Class 'bool' has no instance method 'enable'.
NoSuchMethodError: method not found: 'enable'
Receiver: false
Arguments: [2929]play.dart:17 main
WebGLRenderingContext gl should have the enable method though.
A lot of these examples are very simple. Using private variables and private methods is overkill. @sethladd thinks we should just remove them.
Could you please provide some installation information in the README?
I assume these examples are for beginners, and I know that you just drag the files to the editor and right click to run in dartium, but a lot of them have a big red x on them, which I'm assuming is not supposed to be there.
It says the target URI does not exist here
import 'package:http/http.dart' as http;
but I did pub get on the pubspec.yaml, and pub build, and http/http.dart is in the Referenced Library, but it still says the target URI does not exist.
I would imagine this would be very frustrating for most beginner users. It's not a huge deal to me, because I'm just testing it out for fun, but I bet it would save a lot of people headache if you just gave some basic installation instructions.
EDIT:
Got it to work by right-clicking on pubspec.yaml and choosing "Pub Upgrade"
The following example, which is included in dartlang under /samples, should be modified to follow the /// comment style, rather than /**. This has been fixed in the dartlang space, but should also be fixed here.
https://github.com/dart-lang/dart-samples/blob/master/html5/web/webaudio/intro/filter_sample.dart
Should have it done soon.
https://github.com/html5rocks/www.html5rocks.com/tree/master/content/tutorials/canvas/hidpi
seems like many samples could be rewritten with async await
would be willing to put some effort here
According to http://www.dartlang.org/docs/pub-package-manager/package-layout.html
all the example directories should be moved into example/
See also js-interop: https://github.com/dart-lang/js-interop
'Leaner, Meaner, Faster Animations with requestAnimationFrame' link in README.md spits a 404.
Problem here: https://github.com/dart-lang/dart-html5-amples/tree/master/web/speed/animations
'amples' should be 'samples'
Cheers
requestAnimationFrame has been changed from int to num/double. This brakes a few of the samples that depend on RAF with int time.
There was previously a blocking bug (html5rocks/www.html5rocks.com#163 (comment)), but it looks like it's been resolved.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.