Created
June 20, 2022 03:13
-
-
Save riscait/c3941ed64eec7957e1972bd27ebe158a to your computer and use it in GitHub Desktop.
Type check with Extended class
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
class BaseClass {} | |
class ExtendedClass extends BaseClass {} | |
class OtherClass {} | |
void main() { | |
final baseClass = BaseClass(); | |
final extendedClass = ExtendedClass(); | |
print(extendedClass is BaseClass); // true | |
final otherClass = OtherClass(); | |
print(otherClass is BaseClass); // false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment