Hello World (Web Browser) in Dart PRO

The code we develop in Dart can be executed in a web browser. It can be a web browser that already includes a Dart VM, such as the Chromium, or a simple web browser. When the web browser doesn’t include a Dart VM the code we wrote in Dart will be compiled into JavaScript. The […]

Concurrency with Isolates in Dart PRO

Dart is a single threaded programming language. Each isolate is a unit of work. It has its own memory allocation. Sharing memory between isolates is not possible. Each isolate can pass over messages to the others. When an isolate receives a message it processes it in a way similar to events handling. import “dart:isolate”; var […]

Function as First Class Objects PRO

Similarly to JavaScript, we can pass over functions as objects. We can pass a function as a argument to a another function and we can store a function in a variable. The possibility to define anonymous functions and pass them over as arguments to other functions simplifies the code. goodMorning(str) => print(“Good Morning $str”); goodEvening(str) […]

Factory Constructors in Dart PRO

Appart of having a constructors mechanism similarly to Java and C#, Dart supports the concept of factory constructors. We can define a base class (can also be an abstract class) and provide a factory constructor to be used when a default concrete instance is required. abstract class IRobot { String talk(String str); factory IRobot() { […]

Class Based OOP in Dart PRO

The Dart programming language uses classes and interfaces similarly to Java, C# and PHP. Dart supports single inheritance similarly to Java, C# and PHP. Dart supports multiple interfaces implementation similarly to Java, C# and PHP. As in Java and in C# every class inherits (by default) from the Object class. The classes can have public […]

There is no + Strings Concatenator in Dart PRO

Dart doesn’t provide us with the + operator for concatenating strings. If we want to connect few strings into a new big one we can just place them side by side. void main() { var a = “hello”; var b = “students”; var str = “hello ” “students”; print(str); } The following video clips overviews […]

Ignoring String Interpolation in Dart PRO

Prefixing the string with ‘r’ will cancel any string interpolation within that string. The following code sample shows that. void main() { var numA = 3; var numB = 4; print(r”$numA + $numB = ${numA+numB}”); } The following video clip shows the execution of this code sample, overviews it and explains it.

Strings Interpolation in Dart PRO

Using the $ character or the ${ }  expression within single or double quotes we can convert a non-string value or an expression into string. When converting a single variable into string we will just prefix that variable with the $ sign. When converting an expression we will write it within the curly braces of […]

Multiline Strings in Dart PRO

Using three double quotes we can create strings that span over more than one line. The following code sample shows how to do it. void main() { var str = “”” we all love coding… especially when using a great programming language! “””; print(str); } The following video clip shows the execution of this code […]

Hello World in Dart PRO

Dart is an open source class based, object oriented, optionally typed programming language that allows us to develop browser based one page web applications. We can execute the code that should run on the client side either by using a web browser that supports Dart or by compiling our code into JavaScript. Using the Dart […]

Skip to content Update cookies preferences