Loading your page…
YOUR LEARNING PATH
Short exercises, progressive hints and explanations to help you move forward.
Create a free account to access the lessons and save your progress. Free learning uses daily hearts.
Create my accountAlready have an account? Log inStart with Dart before building Flutter interfaces. Language basics prepare you to understand widgets, composition and state.
Before you start: No installation for initial Dart exercises. Flutter examples require a suitable Flutter environment.
void main() {
final values = [2, 4, 6];
var total = 0;
for (final value in values) {
total += value;
}
print(total);
}main is the entry point. The loop sums each value and print outputs 12. This first example uses Dart alone, without Flutter widgets.
Try it: Move the calculation into a function that receives a list of numbers.
Want to understand what each plan includes? Compare plans
Dart with Flutter compiles natively to iOS, Android, and web from a single shared codebase, delivering 60/120 FPS performance and rapid hot reload development.