From 7fee0c52d399bb36695d5750409589f74569c564 Mon Sep 17 00:00:00 2001 From: Phil Quitslund Date: Mon, 6 Jan 2020 09:43:02 -0800 Subject: [PATCH] mark widget == and hashCode as nonVirtual (#46900) --- packages/flutter/lib/foundation.dart | 1 + packages/flutter/lib/src/widgets/framework.dart | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/packages/flutter/lib/foundation.dart b/packages/flutter/lib/foundation.dart index ecc79249db..37a270b29d 100644 --- a/packages/flutter/lib/foundation.dart +++ b/packages/flutter/lib/foundation.dart @@ -12,6 +12,7 @@ library foundation; export 'package:meta/meta.dart' show immutable, mustCallSuper, + nonVirtual, optionalTypeArgs, protected, required, diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 6252327e34..47f3d56d15 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -451,6 +451,13 @@ abstract class Widget extends DiagnosticableTree { properties.defaultDiagnosticsTreeStyle = DiagnosticsTreeStyle.dense; } + @override + @nonVirtual + bool operator ==(dynamic other) => super==other; + + @override + @nonVirtual + int get hashCode => super.hashCode; /// Whether the `newWidget` can be used to update an [Element] that currently /// has the `oldWidget` as its configuration.