Unverified Commit 671aa9e9 authored by Viren Khatri's avatar Viren Khatri Committed by GitHub

complete migration of flutter repo to Object.hash* (#99505)

parent e047fe7f
...@@ -275,7 +275,7 @@ class BoardPoint { ...@@ -275,7 +275,7 @@ class BoardPoint {
} }
@override @override
int get hashCode => hashValues(q, r); int get hashCode => Object.hash(q, r);
BoardPoint copyWithColor(Color nextColor) => BoardPoint(q, r, color: nextColor); BoardPoint copyWithColor(Color nextColor) => BoardPoint(q, r, color: nextColor);
......
...@@ -37,7 +37,7 @@ class ComponentDemoTabData { ...@@ -37,7 +37,7 @@ class ComponentDemoTabData {
} }
@override @override
int get hashCode => hashValues(tabName, description, documentationUrl); int get hashCode => Object.hash(tabName, description, documentationUrl);
} }
class TabbedComponentDemoScaffold extends StatelessWidget { class TabbedComponentDemoScaffold extends StatelessWidget {
......
...@@ -29,7 +29,7 @@ class GalleryDemoCategory { ...@@ -29,7 +29,7 @@ class GalleryDemoCategory {
} }
@override @override
int get hashCode => hashValues(name, icon); int get hashCode => Object.hash(name, icon);
@override @override
String toString() { String toString() {
......
...@@ -71,7 +71,7 @@ class GalleryOptions { ...@@ -71,7 +71,7 @@ class GalleryOptions {
} }
@override @override
int get hashCode => hashValues( int get hashCode => Object.hash(
themeMode, themeMode,
textScaleFactor, textScaleFactor,
visualDensity, visualDensity,
......
...@@ -21,7 +21,7 @@ class GalleryTextScaleValue { ...@@ -21,7 +21,7 @@ class GalleryTextScaleValue {
} }
@override @override
int get hashCode => hashValues(scale, label); int get hashCode => Object.hash(scale, label);
@override @override
String toString() { String toString() {
...@@ -55,7 +55,7 @@ class GalleryVisualDensityValue { ...@@ -55,7 +55,7 @@ class GalleryVisualDensityValue {
} }
@override @override
int get hashCode => hashValues(visualDensity, label); int get hashCode => Object.hash(visualDensity, label);
@override @override
String toString() { String toString() {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:html' as html; import 'dart:html' as html;
import 'dart:ui';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
...@@ -33,7 +32,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[ ...@@ -33,7 +32,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
packageScheme: 'package', packageScheme: 'package',
package: 'packages', package: 'packages',
packagePath: 'web_integration/stack_trace.dart', packagePath: 'web_integration/stack_trace.dart',
line: 120, line: 119,
column: 3, column: 3,
className: '<unknown>', className: '<unknown>',
method: 'baz', method: 'baz',
...@@ -44,7 +43,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[ ...@@ -44,7 +43,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
packageScheme: 'package', packageScheme: 'package',
package: 'packages', package: 'packages',
packagePath: 'web_integration/stack_trace.dart', packagePath: 'web_integration/stack_trace.dart',
line: 115, line: 114,
column: 3, column: 3,
className: '<unknown>', className: '<unknown>',
method: 'bar', method: 'bar',
...@@ -55,7 +54,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[ ...@@ -55,7 +54,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
packageScheme: 'package', packageScheme: 'package',
package: 'packages', package: 'packages',
packagePath: 'web_integration/stack_trace.dart', packagePath: 'web_integration/stack_trace.dart',
line: 110, line: 109,
column: 3, column: 3,
className: '<unknown>', className: '<unknown>',
method: 'foo', method: 'foo',
...@@ -154,7 +153,7 @@ class StackFrameEquality implements Equality<StackFrame> { ...@@ -154,7 +153,7 @@ class StackFrameEquality implements Equality<StackFrame> {
// TODO(dnfield): This ignore shouldn't be necessary, see https://github.com/dart-lang/sdk/issues/46477 // TODO(dnfield): This ignore shouldn't be necessary, see https://github.com/dart-lang/sdk/issues/46477
@override @override
int hash(StackFrame e) { // ignore: avoid_renaming_method_parameters int hash(StackFrame e) { // ignore: avoid_renaming_method_parameters
return hashValues(e.number, e.packageScheme, e.package, e.packagePath, e.line, e.column, e.className, e.method); return Object.hash(e.number, e.packageScheme, e.package, e.packagePath, e.line, e.column, e.className, e.method);
} }
@override @override
......
...@@ -50,7 +50,7 @@ class User { ...@@ -50,7 +50,7 @@ class User {
} }
@override @override
int get hashCode => hashValues(email, name); int get hashCode => Object.hash(email, name);
} }
class AutocompleteBasicUserExample extends StatelessWidget { class AutocompleteBasicUserExample extends StatelessWidget {
......
...@@ -52,7 +52,7 @@ class User { ...@@ -52,7 +52,7 @@ class User {
} }
@override @override
int get hashCode => hashValues(email, name); int get hashCode => Object.hash(email, name);
} }
class AutocompleteCustomTypeExample extends StatelessWidget { class AutocompleteCustomTypeExample extends StatelessWidget {
......
...@@ -3,9 +3,9 @@ nothing but core Dart packages. They can't depend on `dart:ui`, they ...@@ -3,9 +3,9 @@ nothing but core Dart packages. They can't depend on `dart:ui`, they
can't depend on any `package:`, and they can't depend on anything can't depend on any `package:`, and they can't depend on anything
outside this directory. outside this directory.
Currently they do depend on dart:ui, but only for `VoidCallback` and Currently they do depend on dart:ui, but only for `VoidCallback` (and
`hashValues` (and maybe one day `hashList` and `lerpDouble`), which maybe one day `lerpDouble`), which are all intended to be moved out
are all intended to be moved out of `dart:ui` and into `dart:core`. of `dart:ui` and into `dart:core`.
There is currently also an unfortunate dependency on the platform There is currently also an unfortunate dependency on the platform
dispatcher logic (SingletonFlutterWindow, Brightness, dispatcher logic (SingletonFlutterWindow, Brightness,
......
...@@ -123,7 +123,7 @@ class ExpansionTileThemeData with Diagnosticable { ...@@ -123,7 +123,7 @@ class ExpansionTileThemeData with Diagnosticable {
@override @override
int get hashCode { int get hashCode {
return hashValues( return Object.hash(
backgroundColor, backgroundColor,
collapsedBackgroundColor, collapsedBackgroundColor,
tilePadding, tilePadding,
......
...@@ -41,7 +41,8 @@ export 'dart:ui' show ...@@ -41,7 +41,8 @@ export 'dart:ui' show
TextPosition, TextPosition,
TileMode, TileMode,
VertexMode, VertexMode,
// TODO(werainkhatri): remove these after all the dependencies are migrated // TODO(werainkhatri): remove these after their deprecation period in engine
// https://github.com/flutter/flutter/pull/99505
hashValues, hashValues,
hashList; hashList;
......
...@@ -121,7 +121,7 @@ class KeySet<T extends KeyboardKey> { ...@@ -121,7 +121,7 @@ class KeySet<T extends KeyboardKey> {
: Object.hash(h2, h1); : Object.hash(h2, h1);
} }
// Sort key hash codes and feed to hashList to ensure the aggregate // Sort key hash codes and feed to Object.hashAll to ensure the aggregate
// hash code does not depend on the key order. // hash code does not depend on the key order.
final List<int> sortedHashes = length == 3 final List<int> sortedHashes = length == 3
? _tempHashStore3 ? _tempHashStore3
......
...@@ -90,7 +90,7 @@ class RecordedScale extends RecordedCanvasCall { ...@@ -90,7 +90,7 @@ class RecordedScale extends RecordedCanvasCall {
} }
@override @override
int get hashCode => hashValues(sx, sy); int get hashCode => Object.hash(sx, sy);
} }
void main() { void main() {
......
...@@ -8,7 +8,6 @@ import 'dart:async'; ...@@ -8,7 +8,6 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io' hide Directory; import 'dart:io' hide Directory;
import 'dart:typed_data'; import 'dart:typed_data';
import 'dart:ui' show hashValues, hashList;
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:file/memory.dart'; import 'package:file/memory.dart';
...@@ -873,7 +872,7 @@ class RunInvocation { ...@@ -873,7 +872,7 @@ class RunInvocation {
final String? workingDirectory; final String? workingDirectory;
@override @override
int get hashCode => hashValues(hashList(command), workingDirectory); int get hashCode => Object.hash(Object.hashAll(command), workingDirectory);
bool _commandEquals(List<String> other) { bool _commandEquals(List<String> other) {
if (other == command) { if (other == command) {
......
...@@ -6,8 +6,6 @@ import 'dart:async'; ...@@ -6,8 +6,6 @@ import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:flutter/painting.dart';
import 'test_async_utils.dart'; import 'test_async_utils.dart';
final Map<int, ui.Image> _cache = <int, ui.Image>{}; final Map<int, ui.Image> _cache = <int, ui.Image>{};
...@@ -35,7 +33,7 @@ Future<ui.Image> createTestImage({ ...@@ -35,7 +33,7 @@ Future<ui.Image> createTestImage({
assert(height != null && height > 0); assert(height != null && height > 0);
assert(cache != null); assert(cache != null);
final int cacheKey = hashValues(width, height); final int cacheKey = Object.hash(width, height);
if (cache && _cache.containsKey(cacheKey)) { if (cache && _cache.containsKey(cacheKey)) {
return _cache[cacheKey]!.clone(); return _cache[cacheKey]!.clone();
} }
......
...@@ -581,7 +581,7 @@ class FakeAccessibilityFeatures implements ui.AccessibilityFeatures { ...@@ -581,7 +581,7 @@ class FakeAccessibilityFeatures implements ui.AccessibilityFeatures {
} }
@override @override
int get hashCode => ui.hashValues(accessibleNavigation, invertColors, disableAnimations, boldText, reduceMotion, highContrast); int get hashCode => Object.hash(accessibleNavigation, invertColors, disableAnimations, boldText, reduceMotion, highContrast);
/// This gives us some grace time when the dart:ui side adds something to /// This gives us some grace time when the dart:ui side adds something to
/// [AccessibilityFeatures], and makes things easier when we do rolls to /// [AccessibilityFeatures], and makes things easier when we do rolls to
......
...@@ -738,5 +738,5 @@ class _CustomColor extends Color { ...@@ -738,5 +738,5 @@ class _CustomColor extends Color {
bool operator ==(Object other) => isEqual ?? super == other; bool operator ==(Object other) => isEqual ?? super == other;
@override @override
int get hashCode => hashValues(super.hashCode, isEqual); int get hashCode => Object.hash(super.hashCode, isEqual);
} }
...@@ -1066,7 +1066,7 @@ class PubspecLine { ...@@ -1066,7 +1066,7 @@ class PubspecLine {
class PubspecChecksum extends PubspecLine { class PubspecChecksum extends PubspecLine {
PubspecChecksum(this.value, String line) : super(line); PubspecChecksum(this.value, String line) : super(line);
/// The checksum value, computed using [hashValues] over the direct, dev, /// The checksum value, computed using [Object.hash] over the direct, dev,
/// and special dependencies sorted lexically. /// and special dependencies sorted lexically.
/// ///
/// If the line cannot be parsed, [value] will be null. /// If the line cannot be parsed, [value] will be null.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment