Search⌘ K
AI Features

Solution: Daily Fitness Summary

Explore how to implement Dart's core data types by creating a daily fitness summary. Understand declaring and using String, int, double, and bool variables, and applying string interpolation to produce formatted output. This lesson helps you practice safe and clear code with Dart's type system and variable declarations.

We'll cover the following...
Dart
void main() {
String userName = "Alice";
int stepsTaken = 8500;
double distanceKm = 6.4;
bool hasMetGoal = false;
print("Hello $userName! You have walked $stepsTaken steps ($distanceKm km). Goal met: $hasMetGoal.");
}

Solution explanation

In the main.dart file:

    ...