Useful Links
Computer Science
Programming
By Language
Dart Programming Language
1. Introduction to Dart
2. Dart Language Fundamentals
3. Functions
4. Object-Oriented Programming (OOP) in Dart
5. Collections
6. Asynchronous Programming
7. Error Handling and Exceptions
8. Dart Tooling and Ecosystem
9. Advanced Topics
Dart Language Fundamentals
Variables and Data Types
Declaring Variables
Using `var` for Type Inference
Using `final` for Single-Assignment Variables
Using `const` for Compile-Time Constants
Explicit Type Declarations
Built-in Data Types
Numbers
`int`
`double`
`num`
Numeric Literals
Numeric Operations
Mathematical Functions
Strings
Single and Double Quotes
String Interpolation
Multi-line Strings
Raw Strings
String Concatenation
Common String Methods
String Comparison
Booleans
The `bool` Type
Boolean Literals
Boolean Operations
Records
Syntax and Structure
Named Fields
Positional Fields
Use Cases
Symbols
Purpose and Syntax
Use Cases
The `dynamic` Type
When to Use
Risks and Considerations
Type Checking at Runtime
Type Conversion
Implicit Conversion
Explicit Conversion
Parsing Strings to Numbers
Sound Null Safety
Understanding Null in Dart
Non-Nullable Types
Default Behavior
Compile-Time Guarantees
Nullable Types
Using the `?` Suffix
Working with Nullable Variables
The Null Assertion Operator (`!`)
When to Use
Runtime Risks
The `late` Keyword
Late Initialization
Use Cases
Pitfalls and Best Practices
Migration to Null Safety
Legacy Code Considerations
Operators
Arithmetic Operators
Addition (`+`)
Subtraction (`-`)
Multiplication (`*`)
Division (`/`)
Integer Division (`~/`)
Modulo (`%`)
Unary Operators
Equality and Relational Operators
Equality (`==`)
Inequality (`!=`)
Greater Than (`>`)
Less Than (`<`)
Greater Than or Equal (`>=`)
Less Than or Equal (`<=`)
Type Test Operators
`is`
`is!`
Runtime Type Checking
Assignment Operators
Simple Assignment (`=`)
Compound Assignment
`+=`
`-=`
`*=`
`/=`
`~/=`
`%=`
Logical Operators
AND (`&&`)
OR (`||`)
NOT (`!`)
Short-Circuit Evaluation
Bitwise and Shift Operators
Bitwise AND (`&`)
Bitwise OR (`|`)
Bitwise XOR (`^`)
Bitwise NOT (`~`)
Left Shift (`<<`)
Right Shift (`>>`)
Conditional Expressions
Ternary Operator (`condition ? expr1 : expr2`)
Cascade Notation (`..`)
Chaining Method Calls
Null-Shorting Cascade (`?..`)
Null-aware Operators
Null-aware Access (`?.`)
If-null Operator (`??`)
Null-aware Assignment (`??=`)
Operator Precedence
Order of Operations
Using Parentheses
Control Flow Statements
Conditional Statements
`if` Statement
`else` Statement
`else if` Statement
Nested Conditionals
Looping Constructs
`for` Loop
Traditional For Loop
Loop Variables
`for-in` Loop
Iterating Over Collections
`while` Loop
`do-while` Loop
Loop Control
`break` Statement
`continue` Statement
Labeled Breaks and Continues
Switch Statements
Basic `switch` Syntax
Using `case` Clauses
Pattern Matching in `switch`
Fall-through Behavior
`default` Case
Switch Expressions
Comments and Documentation
Single-line Comments (`//`)
Multi-line Comments (`/* */`)
Documentation Comments (`///`)
Doc Comment Conventions
Previous
1. Introduction to Dart
Go to top
Next
3. Functions