Wednesday, February 6, 2013

"Hello World" to dart, with public property

In this example, the variable name is a public property of class Visitor. It can be access from outside directly.

class Visitor{
  var name;   //public property
}
void main() {
  var visitor = new Visitor();
  visitor.name = "Erik";
  print ("Hello, ${visitor.name}");
}


class with public property
class with public property

No comments:

Post a Comment