Tag Archive: Examples

Jan
23
2012

New language specification (v0.07) and new version of the Dart Editor (3331)

It appears the new version of Editor Dart (3331), you can check your news and download it here and with it also comes into play a new language specification v0.07 with several new features,you can read about these developments and see the document by following this link .

 

Permanent link to this article: http://www.dartexperience.com/en/2012/01/23/nueva-especificacion-del-lenguaje-v0-07-y-nueva-version-del-dart-editor-3331/

Jan
21
2012

Why Dart Types Are Optional and Unsound. Part 2

Before we start: Code used in this article

We continue with the guys at Dart, in this short article will show the code that we use later in the following article, it’s some guys with a small hierarchy and some variables:


class Mammal {}

class Cow extends Mammal { String moo() => 'moo!'; }

class Pig extends Mammal { String oink() => 'oink!'; }

Mammal mammal = new Mammal();

Cow cow = new Cow();

Pig pig = new Pig();

Fuente: Dartlang

Permanent link to this article: http://www.dartexperience.com/en/2012/01/21/%c2%bfpor-que-los-tipos-en-dart-son-opcionales-y-poco-solidos-parte-2/

Nov
29
2011

Factories / Pool Object Dart

With the current builders object factories are always asked a new object, the problem is that the programmer does not always want a new object, that gives us the advantage to pick up theobjects housed in the cache: There are several design patterns to do this correctly, but Dartmakes it easy with special constructs for factories. (Colloquially called constructors without tears).
 

The instance creation expressions are based on interfaces and minimizes the need fordependency injection.

Example of use of factory:

interface Person factory PersonFactory{
    Person(name);
    final name;
}
class PersonFactory{
   factory Person(name){
    if(name== null) return const Ghost();
    return new RealPerson(name);
   }
}
class RealPerson implements Person{
  RealPerson(this.name);
  final name;
}
class Ghost implements Person{
  const Ghost();
  get name() => "ghost";
}
main(){
  print(new Person("Pepita") is RealPerson);
  print(new Person(null) is Ghost);
}

Permanent link to this article: http://www.dartexperience.com/en/2011/11/29/factoriaspool-de-objetos-en-dart/

Nov
26
2011

Useful libraries Dart Part 1 – SlideMenu

Some research in the libraries that come with our Dart Editor can be found very useful libraries try to go slowly showing in this series of tutorials called “Libraries Dart useful” to the first article of reference use the example “Slide sample ”which is also included when you get off Dart Editor. This example uses a library called “SlideMenu” to create a simple navigation menu, I find very interesting, because it encapsulates the HTML code inside the library and can edit at will, even overwrite it so you can give a lot of play.

Let’s start talking about the class SliderMenu.dart itself:

The first thing that strikes me is that it extends a class called “View”, so I think it is a view controller methods “windowResized ()” or “addToDocument (Element parentNode).”

We have several methods to “SlideMenu.dart” the most important is: Read the rest of this entry »

Permanent link to this article: http://www.dartexperience.com/en/2011/11/26/useful-libraries-dart-part-1-slidemenu/

Nov
14
2011

Dart and HTML Elements. Part 3

This post is a continuation of our two previous articles, if you do not understand something, maybe you should consult they (Part 1, Part 2). It’s inspired on the Chris Buckett’s example.

We will create a simple form to collect name and surname and greet to our visitors. We will create the form dynamically using constructors. We will use an event to capture the button clicked event and we will show a text into a div for our greeting.

This is the structure of the example:

client/client.html – Page with reference to our script, nothing more.

Read the rest of this entry »

Permanent link to this article: http://www.dartexperience.com/en/2011/11/14/dart-and-html-elements-part-3/

Pag. 1 of 212