Skip to content

Instantly share code, notes, and snippets.

@RedBrogdon
Last active June 9, 2020 16:41
Show Gist options
  • Save RedBrogdon/4ce48b97196304dda3ce56fa568c44b8 to your computer and use it in GitHub Desktop.
Save RedBrogdon/4ce48b97196304dda3ce56fa568c44b8 to your computer and use it in GitHub Desktop.
Snippet 2: Nullable types
// What if you need a variable that can hold a null
// value? You can declare it nullable by adding a
// question mark to the end of the type. In this
// case, try `int?`.
void main() {
int a;
a = null;
print('a is $a.');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment