Complete the code to declare a variable with type inference holding the number 10.
var number = [1];The keyword var lets Dart infer the type from the assigned value. Here, 10 is an integer, so number becomes an int.
Complete the code to declare a variable with type inference holding the text 'Hello'.
var greeting = [1];Text values must be inside quotes. Double or single quotes work, but here double quotes are correct and complete.
Fix the error in the code by completing the variable declaration with type inference for a decimal number.
var price = [1];Decimal numbers need to be written as numeric literals with a dot, without quotes, so Dart infers a double type.
Fill both blanks to declare a variable with explicit type and assign it a boolean value.
[1] isActive = [2];
var when explicit type is asked.Explicitly declaring the type bool tells Dart this variable holds true/false values. Assigning true sets it to true.
Fill both blanks to declare a variable with type inference, assign a list of integers, and access the first element.
var numbers = [1]; int first = numbers[2]; print(first);;
The list [1, 2, 3] holds integers. Indexing uses square brackets starting at 0, so numbers[0] gets the first element. Statements end with a semicolon ;.