Wednesday, February 6, 2013

Setter and Getter for private property, in dart.

To define private member in dart, prefix the name with underscore(_) character. This example demonstrate how to implement setter and getter for private member.

class Visitor{
  var _name;   //private property
  
  set name(value) => _name = value; //setter for private property
  get name => _name;                //getter for private property
}
void main() {
  var visitor = new Visitor();
  visitor.name = "Erik";
  print ("Hello, ${visitor.name}");
}


Setter and Getter for private property
Setter and Getter for private property

"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

"Hello World" to dart

"Hello World" to dart
"Hello World" to dart

Friday, February 1, 2013

Thursday, January 31, 2013

Qt 5.0.1 and Qt Creator 2.6.2 Released

It’s been six weeks since the Qt 5.0.0 released, the first patch Qt 5.0.1 released.

With over 400 improvements compared to Qt 5.0.0 the Qt 5.0.1 is a great next step for the Qt 5 series. As a patch release it does not introduce new functionality, just error corrections and improvements. In addition to these, it also adds MinGW 4.7 pre-build binary installer, which has been highly requested. MinGW is the first but not the last new pre-build binary installer which we are going to bring along on later Qt 5.0.x releases.

Know more: Qt Blog, Qt 5.0.1 Released.

Qt Creator 2.6.2 has just been released. A quick count yields 55 patches on top of 2.6.1, the majority of them of the Mostly Harmless kind, fixing usability and UI issues. Some serious issues got fixed, too, most notably the code editor freeze some people encountered on certain constructs in the C++ editor

Source: Qt Blog, Qt Creator 2.6.2 released.

Dart in Action


Summary
Dart in Action introduces Google's Dart language and provides techniques and examples showing how to use it as a viable replacement for Java and JavaScript in browser-based desktop and mobile applications. It begins with a rapid overview of Dart language and tools, including features like interacting with the browser, optional typing, classes, libraries, and concurrency with isolates. After you master the core concepts, you'll move on to running Dart on the server and creating single page HTML5 web applications.
About the Technology
Dart is a web programming language developed by Google. It has modern OO features, just like Java or C#, while keeping JavaScript's dynamic and functional characteristics. Dart applications are "transpiled" to JavaScript, and they run natively in Dart-enabled browsers. With production-quality libraries and tools, Dart operates on both the client and the server for a consistent development process.
About this Book
Dart in Action introduces the Dart language and teaches you to use it in browser-based, desktop, and mobile applications. Not just a language tutorial, this book gets quickly into the nitty-gritty of using Dart. Most questions that pop up while you're reading are answered on the spot! OO newbies will appreciate the gentle pace in the early chapters. Later chapters take a test-first approach and encourage you to try Dart hands-on.
To benefit from this book you'll need experience with HTML and JavaScript?a Java or C# background is helpful but not required.
Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.
What's Inside
  • Dart from the ground up
  • Numerous code samples and diagrams
  • Creating single-page web apps
  • Transitioning from Java, C#, or JavaScript
  • Running Dart in the browser and on the server
About the Author
Chris Buckett builds enterprise-scale web applications. He runs Dartwatch.com and is an active contributor to the dartlang list.
"Includes numerous examples of core language features as well as more advanced HTML5 features."—From the Foreword by Seth Ladd, Developer Advocate, Google
Table of Contents
PART 1 INTRODUCING DART
  1. Hello Dart
  2. "Hello World" with Dart tools
  3. Building and testing your own Dart app

  4. PART 2 CORE DART
  5. Functional first-class functions and closures
  6. Understanding libraries and privacy
  7. Constructing classes and interfaces
  8. Extending classes and interfaces
  9. Collections of richer classes
  10. Asynchronous programming with callbacks and futures
  11. PART 3 CLIENT-SIDE DART APPS
  12. Building a Dart web app
  13. Navigating offline data
  14. Communicating with other systems and languages

  15. PART 4 SERVER-SIDE DART

  16. Server interaction with files and HTTP
  17. Sending, syncing, and storing data
  18. Concurrency with isolates