Menu

Dart Explained: Google's Language Behind Flutter
πŸ“°

Dart Explained: Google's Language Behind Flutter

DEV Community: dartΒ·The Practical DeveloperΒ·about 20 hours ago
#PC3iDcrS
#devtodart#devto#dev#dart#null
Reading 0:00
15s threshold

Introduction

Dart is Google's language for building apps, and it is best known as the language of Flutter β€” the framework that builds apps for phones, web, and desktop from one codebase. But Dart is worth understanding on its own: it is a modern, typed language with one of the clearest approaches to missing values and asynchronous code in any mainstream language.

Sound null safety: the compiler guarantees it

Dart's null safety is "sound": if the compiler says your code is null-safe, it really is β€” no runtime surprises. Like Kotlin and Swift, Dart marks nullable types with ? :

void main () { String name = "Sara" ; // name = null; // Error: null is not a String String ? nickname = null ; print ( nickname ?. length ); // null, no crash print ( nickname ?? "No nickname" ); // "No nickname" }

Enter fullscreen mode

Exit fullscreen mode

The ?. safe-call operator and ?? fallback operator work exactly as in Kotlin.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.