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 {
}
@override
int get hashCode => hashValues(q, r);
int get hashCode => Object.hash(q, r);
BoardPoint copyWithColor(Color nextColor) => BoardPoint(q, r, color: nextColor);
......
......@@ -37,7 +37,7 @@ class ComponentDemoTabData {
}
@override
int get hashCode => hashValues(tabName, description, documentationUrl);
int get hashCode => Object.hash(tabName, description, documentationUrl);
}
class TabbedComponentDemoScaffold extends StatelessWidget {
......
......@@ -29,7 +29,7 @@ class GalleryDemoCategory {
}
@override
int get hashCode => hashValues(name, icon);
int get hashCode => Object.hash(name, icon);
@override
String toString() {
......
......@@ -71,7 +71,7 @@ class GalleryOptions {
}
@override
int get hashCode => hashValues(
int get hashCode => Object.hash(
themeMode,
textScaleFactor,
visualDensity,
......
......@@ -21,7 +21,7 @@ class GalleryTextScaleValue {
}
@override
int get hashCode => hashValues(scale, label);
int get hashCode => Object.hash(scale, label);
@override
String toString() {
......@@ -55,7 +55,7 @@ class GalleryVisualDensityValue {
}
@override
int get hashCode => hashValues(visualDensity, label);
int get hashCode => Object.hash(visualDensity, label);
@override
String toString() {
......
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
import 'dart:html' as html;
import 'dart:ui';
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
......@@ -33,7 +32,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
packageScheme: 'package',
package: 'packages',
packagePath: 'web_integration/stack_trace.dart',
line: 120,
line: 119,
column: 3,
className: '<unknown>',
method: 'baz',
......@@ -44,7 +43,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
packageScheme: 'package',
package: 'packages',
packagePath: 'web_integration/stack_trace.dart',
line: 115,
line: 114,
column: 3,
className: '<unknown>',
method: 'bar',
......@@ -55,7 +54,7 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
packageScheme: 'package',
package: 'packages',
packagePath: 'web_integration/stack_trace.dart',
line: 110,
line: 109,
column: 3,
className: '<unknown>',
method: 'foo',
......@@ -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
@override
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
......
......@@ -50,7 +50,7 @@ class User {
}
@override
int get hashCode => hashValues(email, name);
int get hashCode => Object.hash(email, name);
}
class AutocompleteBasicUserExample extends StatelessWidget {
......
......@@ -52,7 +52,7 @@ class User {
}
@override
int get hashCode => hashValues(email, name);
int get hashCode => Object.hash(email, name);
}
class AutocompleteCustomTypeExample extends StatelessWidget {
......
......@@ -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
outside this directory.
Currently they do depend on dart:ui, but only for `VoidCallback` and
`hashValues` (and maybe one day `hashList` and `lerpDouble`), which
are all intended to be moved out of `dart:ui` and into `dart:core`.
Currently they do depend on dart:ui, but only for `VoidCallback` (and
maybe one day `lerpDouble`), which are all intended to be moved out
of `dart:ui` and into `dart:core`.
There is currently also an unfortunate dependency on the platform
dispatcher logic (SingletonFlutterWindow, Brightness,
......
......@@ -123,7 +123,7 @@ class ExpansionTileThemeData with Diagnosticable {
@override
int get hashCode {
return hashValues(
return Object.hash(
backgroundColor,
collapsedBackgroundColor,
tilePadding,
......
......@@ -41,7 +41,8 @@ export 'dart:ui' show
TextPosition,
TileMode,
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,
hashList;
......
......@@ -121,7 +121,7 @@ class KeySet<T extends KeyboardKey> {
: 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.
final List<int> sortedHashes = length == 3
? _tempHashStore3
......
......@@ -90,7 +90,7 @@ class RecordedScale extends RecordedCanvasCall {
}
@override
int get hashCode => hashValues(sx, sy);
int get hashCode => Object.hash(sx, sy);
}
void main() {
......
......@@ -8,7 +8,6 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io' hide Directory;
import 'dart:typed_data';
import 'dart:ui' show hashValues, hashList;
import 'package:file/file.dart';
import 'package:file/memory.dart';
......@@ -873,7 +872,7 @@ class RunInvocation {
final String? workingDirectory;
@override
int get hashCode => hashValues(hashList(command), workingDirectory);
int get hashCode => Object.hash(Object.hashAll(command), workingDirectory);
bool _commandEquals(List<String> other) {
if (other == command) {
......
......@@ -6,8 +6,6 @@ import 'dart:async';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/painting.dart';
import 'test_async_utils.dart';
final Map<int, ui.Image> _cache = <int, ui.Image>{};
......@@ -35,7 +33,7 @@ Future<ui.Image> createTestImage({
assert(height != null && height > 0);
assert(cache != null);
final int cacheKey = hashValues(width, height);
final int cacheKey = Object.hash(width, height);
if (cache && _cache.containsKey(cacheKey)) {
return _cache[cacheKey]!.clone();
}
......
......@@ -581,7 +581,7 @@ class FakeAccessibilityFeatures implements ui.AccessibilityFeatures {
}
@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
/// [AccessibilityFeatures], and makes things easier when we do rolls to
......
......@@ -738,5 +738,5 @@ class _CustomColor extends Color {
bool operator ==(Object other) => isEqual ?? super == other;
@override
int get hashCode => hashValues(super.hashCode, isEqual);
int get hashCode => Object.hash(super.hashCode, isEqual);
}
......@@ -1066,7 +1066,7 @@ class PubspecLine {
class PubspecChecksum extends PubspecLine {
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.
///
/// 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