Created
June 15, 2022 14:49
-
-
Save karabanovbs/2f3c5749cc404b042818afec609218f6 to your computer and use it in GitHub Desktop.
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
void main() { | |
var a = const ImmutablePoint(1, 1); | |
var b = const ImmutablePoint(1, 1); | |
var c = ImmutableCircle(); | |
var d = ImmutableCircle(); | |
print(identical(a, b)); | |
print(identical(c, d)); | |
} | |
class ImmutablePoint { | |
static const ImmutablePoint origin = ImmutablePoint(0, 0); | |
final double x, y; | |
const ImmutablePoint(this.x, this.y); | |
} | |
class ImmutableCircle {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment