Random; // Import a class from a library. void main() { // The app starts executing here. print(new Dice(n: 12).roll()); // Print a new object's value. } class Dice { // Define a class. static Random shaker = new Random(); // Define a class variable. int sides, value; // Define instance variables. String toString() => '$value'; // Define a method using shorthand syntax. Dice({int n: 6}) { // Define a constructor. if (4 <= n && n <= 20) { sides = n; } else { throw new ArgumentError(/* */); // Support for errors and exceptions. } } int roll() { // Define an instance method. return value = shaker.nextInt(sides) + 1; // Get a random number. } }
num _strength; num get strength { // some code return this._strength; } set strength(num value) { // do something with value; this._strength = value; } }
A application using google play game services version: 0.1.0 author: Giovanni Laquidara dependencies: googleapis: any googleapis_auth: any browser: any core_elements: ">=0.2.0 <0.3.0" polymer: ">=0.12.0 <0.13.0" paper_elements: ">=0.1.0 <0.2.0" pubspec.yaml
use classes, annotations, and more. Build apps that scale. AngularDart brings the proven Angular philosophy of testable, succinct web development to Dart.
use classes, annotations, and more. Build apps that scale. AngularDart brings the proven Angular philosophy of testable, succinct web development to Dart. AngularDart embraces modern web platform features, starting with Shadow DOM and Web Components.