This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This example can be run at https://dartpad.dartlang.org/c09c790d954c5d53572cb9661b36ff43 | |
// For other examples see https://gist.github.com/kirkdrichardson | |
void main() { | |
// The Difference between "final" and "const" in Dart (as of v2.2) | |
// Both final and const prevent a variable from being reassigned | |
// (similar to how final works in Java or how const works in JavaScript). | |
final once = "My final var"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Control Flow in Dart (since v2.2) | |
// This example can be run at https://dartpad.dartlang.org/dd957e22c8a763138b57b0e807e2734c | |
// For other examples see https://gist.github.com/kirkdrichardson | |
void main() { | |
// if / else conditional | |
bool happy = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables and literals in Dart (as of v2.2) | |
// This example can be run at https://dartpad.dartlang.org/8e4e9266aa82674e7e0748413b3e88b2 | |
// For other examples see https://gist.github.com/kirkdrichardson | |
void main() { | |
// NOTE - all data types in Dart are objects, so the default type is null | |
// TYPES OF NUMBERS - only "int" and "double" (both are 64-bit) | |
NewerOlder