Avoid runtimeType.toString in describeIdentity (#49087)

This commit is contained in:
Dan Field
2020-01-17 15:23:01 -08:00
committed by Flutter GitHub Bot
parent dc94e479d1
commit 1a061dd8e5

View File

@@ -9,6 +9,7 @@ import 'package:meta/meta.dart';
import 'assertions.dart';
import 'constants.dart';
import 'debug.dart';
import 'object.dart';
// Examples can assume:
// int rows, columns;
@@ -2962,7 +2963,7 @@ String shortHash(Object object) {
/// distinguish instances of the same class (hash collisions are
/// possible, but rare enough that its use in debug output is useful).
/// * [Object.runtimeType], the [Type] of an object.
String describeIdentity(Object object) => '${object.runtimeType}#${shortHash(object)}';
String describeIdentity(Object object) => '${objectRuntimeType(object, '<optimized out>')}#${shortHash(object)}';
// This method exists as a workaround for https://github.com/dart-lang/sdk/issues/30021
/// Returns a short description of an enum value.