Git Product home page Git Product logo

dart-samples's People

Contributors

adam-singer avatar amouravski avatar butlermatt avatar chalin avatar damondouglas avatar danofa avatar filiph avatar jason9t avatar jjinux avatar johnmccutchan avatar kevmoo avatar kwalrath avatar marycampione avatar mit-mit avatar mplacona avatar sethladd avatar sfshaza2 avatar sgjesse avatar shailen avatar vprusso avatar zoechigist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dart-samples's Issues

bug in solar3d on mouse wheel event

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;

screen

bug in solar3d on exit full screen using key "F"

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.

capture

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.

dart:crypto is no more

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';
^

Archive this repo

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

Line length too long

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.

Delete html5/.pub

Maybe html5/pubspec.lock, too. Also, add .pub & (if appropriate) pubspec.lock to .gitignore.

Exception: Class 'bool' has no instance method 'enable'.

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.

Get rid of the privates

A lot of these examples are very simple. Using private variables and private methods is overkill. @sethladd thinks we should just remove them.

Can't get some samples to work

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.