Created
February 25, 2021 15:57
-
-
Save guid-empty/897c99c184d683acc20bb5512169c55a to your computer and use it in GitHub Desktop.
Dart.Language.Variables & checking the type
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() { | |
num value = 10; | |
bool isObject = value is Object; | |
print(value.runtimeType); | |
print(isObject); | |
Object obj = value as Object; | |
print(obj.runtimeType); | |
bool isNotString = value is! String; | |
print(isNotString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment