Skip to content

Instantly share code, notes, and snippets.

@AlexVegner
Created January 22, 2020 15:50
Show Gist options
  • Save AlexVegner/0f1b4abb976116dbe36b4ecdb0bec99b to your computer and use it in GitHub Desktop.
Save AlexVegner/0f1b4abb976116dbe36b4ecdb0bec99b to your computer and use it in GitHub Desktop.
dart_default_value.dart
void main() {
/// Uninitialized variables have an initial value of null. Even variables with numeric types are initially null, because numbers—like everything else in Dart—are objects.
int lineCount;
assert(lineCount == null); // woesn't work in dartpad
print(lineCount);
// Note: Production code ignores the assert() call. During development, on the other hand, assert(condition) throws an exception if condition is false. For details, see Assert.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment