Last active
May 26, 2018 05:46
-
-
Save ezura/809e73461ce6d07434c8926c8703a82a to your computer and use it in GitHub Desktop.
This file contains 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
void main() { | |
var tmp = "tmp"; | |
final finalVar = tmp; | |
// Const variables must be initialized with a constant value. | |
// const constVar = tmp; | |
const _constVar = "const"; | |
const constVar = _constVar; | |
print(finalVar + constVar); | |
} |
This file contains 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
void main() { | |
const Null nullVar = null; // type is Null | |
// type(str); | |
//str = "change"; | |
print(nullVar.runtimeType.toString()); | |
const String strVar = null; | |
const int intVar = null; | |
print(nullVar == strVar); | |
print(intVar == nullVar); | |
print(intVar == strVar); | |
assert(false); | |
List<int> nums = [1, 2, 3]; | |
//nums.add("4") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment