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

This commit is contained in:
Viren Khatri
2022-03-05 02:26:21 +05:30
committed by GitHub
parent e047fe7fc7
commit 671aa9e95e
18 changed files with 25 additions and 28 deletions

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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);
}