From 3ce3b52ea5b1fcfa7e1140d771040e171419e66f Mon Sep 17 00:00:00 2001 From: pq Date: Thu, 12 Dec 2019 10:56:25 -0800 Subject: [PATCH 1/2] mark widget == and hashCode as nonVirtual --- packages/flutter/lib/src/widgets/framework.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index f6084e43ce1bb..3a0656258a2c0 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -8,6 +8,7 @@ import 'dart:developer'; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; +import 'package:meta/meta.dart'; import 'debug.dart'; import 'focus_manager.dart'; @@ -451,6 +452,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. From b83adc72be06e38f5ce0552dfbbfb92f860d1d70 Mon Sep 17 00:00:00 2001 From: pq Date: Thu, 12 Dec 2019 13:31:38 -0800 Subject: [PATCH 2/2] fix meta acccess --- packages/flutter/lib/foundation.dart | 1 + packages/flutter/lib/src/widgets/framework.dart | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/lib/foundation.dart b/packages/flutter/lib/foundation.dart index ecc79249dbe3e..37a270b29dcd3 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 3a0656258a2c0..0efeaeee5d351 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -8,7 +8,6 @@ import 'dart:developer'; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; -import 'package:meta/meta.dart'; import 'debug.dart'; import 'focus_manager.dart';