Dart Flashcards
What is required for a dart program
A main method
How should variables be named in Dart
Camel Case
How do you accomplish string interpolation in Dart
$variableName
How can you interpolate an expression in Dart?
${expression}
How do you escape special characters
/
How do you print a string without having to escape special characters?
r”stuff” - raw string
What is multi line string syntax?
”"”stuff”””
How do you do integer division?
~/
What effect does the prefix and postfix operators have?
Prefix (++x) adds and then assigns the value of x, postfix (x++) assigns the value of x and then adds
How do you write a hex number?
0x(number)
How can you print numbers in binary or hex?
(string).toRadixString((base))
Expressions
Hold a value at runtime
Statements
Do not hold a value at runtime
When is var used?
To declare variables that can be used more than once
When is final used?
For read only variables