The Core Types: int, double, String, bool
Meet Dart's everyday built-in types.
The Core Types: int, double, String, bool is a free Dart Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Dart Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Dart Has Built-in Types
Every value in Dart has a type that describes what it is and what you can do with it. Four types cover most early code.
Whole Numbers With int
An int holds whole numbers with no fractional part, like counts, ages, and indexes. No decimal point is allowed.
int age = 30;Decimals With double
A double stores numbers with a decimal point, such as prices or measurements. Write at least one digit after the dot.
double price = 9.99;int and double Share num
Both int and double are kinds of num. When you need either, the num type accepts whole and decimal numbers alike.
num value = 7;
value = 7.5;Text With String
A String holds text: letters, words, or whole sentences. Wrap the text in single or double quotes.
String city = "Tokyo";True or False With bool
A bool can only ever be true or false. It powers every decision your program will later make.
bool isReady = true;Only Two bool Values
Unlike some languages, a Dart bool is strictly true or false. There is no truthy zero or empty-string shortcut here.
Types Guide What You Can Do
The type decides the operations available. You can add ints, but joining text uses different tools than adding numbers.
Default Values Are null
An uninitialized variable starts as null until you give it a value. Dart makes you handle that case on purpose.
Checking a Value Type
Use the is operator to ask whether a value matches a type. It answers with a handy bool you can act on.
print(9.99 is double); // truePicking the Right Core Type
Counting? Use int. Measuring? Use double. Showing text? Use String. Yes-or-no? Use bool. Match the type to the meaning.
Quick Check
Which core type should hold a product price like 9.99?
Recap: The Four Core Types
You met int for whole numbers, double for decimals, String for text, and bool for true or false. Each value has a clear type. 🎯
Frequently asked questions
Is the “The Core Types: int, double, String, bool” lesson free?
Yes — the full text of “The Core Types: int, double, String, bool” is free to read here on the web, and the Dart Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Dart Academy course, upgrade to CoddyKit PRO.
What will I learn in “The Core Types: int, double, String, bool”?
Meet Dart's everyday built-in types. You practise Dart Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Dart Academy?
No prior experience is required. Dart Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The Core Types: int, double, String, bool” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Dart Academy lesson?
Yes. Every Dart Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- var, final, and const Explained
- The Core Types: int, double, String, bool
- Type Inference vs Explicit Types
- The dynamic and Object Types