On this page11 sections
Lecture 002 — What Is Dart?
| Category | 2 — Getting Started |
| Lecture | 002 of 057 |
| Estimated video length | 10 min |
| Target | Dart 3.12 |
| Level | Beginner |
Before writing any code, we answer two questions: what kind of language Dart is, and why so many app developers pick it.
Contents
Prerequisites · Objectives · Lesson · Code Examples · Common Mistakes · Practice Questions · Answers · Takeaways
Prerequisites
Lecture 001.
Learning Objectives
- Say in one sentence what Dart is
- Name the main reasons developers choose Dart
- Know where Dart code can run
- Understand how Dart and Flutter are related
1. What Dart Is
Dart is a general-purpose programming language made by Google. You write instructions in
plain text files ending in .dart, and the Dart tools turn them into a program that runs.
It is:
- Typed — every value has a type (
int,String, …), and many mistakes are caught before the program even runs. - Null safe — a variable can only be empty (
null) if you say so, which removes a whole family of crashes. - Object-oriented — everything you work with is an object, built from a class.
2. Why Use Dart
| Reason | What it means for you |
|---|---|
| Fast | While developing, changes show up in a second. For release, Dart compiles to fast native machine code. |
| Easy to read | The syntax looks like other popular languages (Java, C#, JavaScript), so it is quick to pick up. |
| Flutter | Flutter, the toolkit for building apps for phones, web and desktop, uses Dart. |
| One codebase | The same Dart code can run on Android, iOS, the web, Windows, macOS, Linux and servers. |
3. Where Dart Runs
| Target | How |
|---|---|
| Your terminal | dart run — command-line programs (this course) |
| Phones & desktops | compiled to native code, usually through Flutter |
| Browsers | compiled to JavaScript or WebAssembly |
| Servers | a compiled program or dart run on the server |
4. Dart and Flutter
Flutter is not a language — it is a set of ready-made building blocks (buttons, lists, screens) written in Dart. Learning Dart first means that when you open Flutter, the only new thing is Flutter.
Code Examples
Example 1 — A Taste of Dart
You don't need to understand every line yet — just read it.
void main() {
String name = 'Ayesha';
int lecturesDone = 2;
print('Hello, $name!');
print('You have finished $lecturesDone lectures.');
}Output
Hello, Ayesha!
You have finished 2 lectures.Even without training you can guess what this does — that readability is one of Dart's strengths. Lecture 004 explains every part of it.
Common Beginner Mistakes
1. Thinking Dart and Flutter are the same thing. Dart is the language; Flutter is a toolkit written in it.
2. Skipping the language and jumping to apps. Most Flutter problems beginners face are really Dart problems — types, null safety, functions. Learn those first.
Practice Questions
- Who created Dart?
- What does "null safe" mean, in your own words?
- Name three places Dart code can run.
- Is Flutter a programming language?
Practice Answers
- Google.
- A variable can't hold "nothing" (
null) unless you declare that it may. - Any three of: terminal, Android, iOS, web browsers, desktop, servers.
- No — Flutter is a toolkit written in Dart.
Key Takeaways
- Dart is a typed, null-safe, object-oriented language from Google.
- It is fast while developing and fast when released.
- One Dart codebase can run almost everywhere; Flutter uses it for apps.
- This course writes terminal programs to learn the language itself.