Statements: End with a semicolon ;
.
Comments: //
for single-line, /* ... */
for multi-line.
Variables: Declared using var
, dynamic
, or specific types (e.g., int
, String
).
Browse / Dart Programming Language Cheatsheet
Missing something?
Dart Programming Language Cheatsheet
A comprehensive cheat sheet for the Dart programming language, covering syntax, data types, control flow, classes, and more. Perfect for quick reference and learning.
Dart Basics
Syntax Overview
|
Functions: Defined using |
Data Types
|
Integers (whole numbers). |
|
Floating-point numbers. |
|
Sequence of characters. |
|
Boolean values: |
|
Ordered collection of items. |
|
Collection of key-value pairs. |
Variables
Declaring variables:
|
Control Flow
Conditional Statements
If-Else Statement:
|
Switch Statement:
|
Loops
For Loop:
|
While Loop:
|
Do-While Loop:
|
For-In Loop:
|
Exception Handling
|
Functions and Classes
Functions
|
Optional Parameters:
|
Classes
|
Inheritance:
|
Asynchronous Programming
Futures
|
Streams
|
Async/Await
Used to simplify asynchronous code, making it look and behave a bit more like synchronous code.
|