Skip to content

Instantly share code, notes, and snippets.

@karabanovbs
Created June 15, 2022 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karabanovbs/2f3c5749cc404b042818afec609218f6 to your computer and use it in GitHub Desktop.
Save karabanovbs/2f3c5749cc404b042818afec609218f6 to your computer and use it in GitHub Desktop.
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