Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0d81bdf5
Commit
0d81bdf5
authored
Feb 16, 2017
by
Todd Volkert
Committed by
GitHub
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify the format of all objects' inclusion of hashCode in toString() (#8192)
parent
e43b40ff
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
31 additions
and
30 deletions
+31
-30
material.dart
packages/flutter/lib/src/material/material.dart
+1
-1
box.dart
packages/flutter/lib/src/rendering/box.dart
+1
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+2
-2
semantics.dart
packages/flutter/lib/src/rendering/semantics.dart
+1
-1
asset_bundle.dart
packages/flutter/lib/src/services/asset_bundle.dart
+2
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+8
-8
overlay.dart
packages/flutter/lib/src/widgets/overlay.dart
+1
-1
service_extensions_test.dart
...ages/flutter/test/foundation/service_extensions_test.dart
+9
-8
decoration_test.dart
packages/flutter/test/painting/decoration_test.dart
+1
-1
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+1
-1
image_test.dart
packages/flutter/test/widgets/image_test.dart
+4
-4
No files found.
packages/flutter/lib/src/material/material.dart
View file @
0d81bdf5
...
...
@@ -405,5 +405,5 @@ abstract class InkFeature {
void
paintFeature
(
Canvas
canvas
,
Matrix4
transform
);
@override
String
toString
()
=>
'
$runtimeType
@
$hashCode
'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
'
;
}
packages/flutter/lib/src/rendering/box.dart
View file @
0d81bdf5
...
...
@@ -512,7 +512,7 @@ class BoxHitTestEntry extends HitTestEntry {
final
Point
localPosition
;
@override
String
toString
()
=>
'
${target.runtimeType}
@
$localPosition
'
;
String
toString
()
=>
'
${target.runtimeType}
#
${target.hashCode}
@
$localPosition
'
;
}
/// Parent data used by [RenderBox] and its subclasses.
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
0d81bdf5
...
...
@@ -620,7 +620,7 @@ abstract class _SemanticsFragment {
Iterable
<
SemanticsNode
>
compile
({
_SemanticsGeometry
geometry
,
SemanticsNode
currentSemantics
,
SemanticsNode
parentSemantics
});
@override
String
toString
()
=>
'
$runtimeType
(
$hashCode
)
'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
'
;
}
/// Represents a subtree that doesn't need updating, it already has a
...
...
@@ -2396,7 +2396,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// Returns a human understandable name.
@override
String
toString
()
{
String
header
=
'
$runtimeType
'
;
String
header
=
'
$runtimeType
#
$hashCode
'
;
if
(
_relayoutBoundary
!=
null
&&
_relayoutBoundary
!=
this
)
{
int
count
=
1
;
RenderObject
target
=
parent
;
...
...
packages/flutter/lib/src/rendering/semantics.dart
View file @
0d81bdf5
...
...
@@ -760,5 +760,5 @@ class SemanticsOwner extends ChangeNotifier {
}
@override
String
toString
()
=>
'
$runtimeType
@
$hashCode
'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
'
;
}
packages/flutter/lib/src/services/asset_bundle.dart
View file @
0d81bdf5
...
...
@@ -74,7 +74,7 @@ abstract class AssetBundle {
void
evict
(
String
key
)
{
}
@override
String
toString
()
=>
'
$runtimeType
@
$hashCode
()'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
()'
;
}
/// An [AssetBundle] that loads resources over the network.
...
...
@@ -120,7 +120,7 @@ class NetworkAssetBundle extends AssetBundle {
// should implement evict().
@override
String
toString
()
=>
'
$runtimeType
@
$hashCode
(
$_baseUrl
)'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
(
$_baseUrl
)'
;
}
/// An [AssetBundle] that permanently caches string and structured resources
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
0d81bdf5
...
...
@@ -95,7 +95,7 @@ class UniqueKey extends LocalKey {
UniqueKey
();
@override
String
toString
()
=>
'[
$hashCode
]'
;
String
toString
()
=>
'[
#
$hashCode
]'
;
}
/// A key that takes its identity from the object used as its value.
...
...
@@ -123,8 +123,8 @@ class ObjectKey extends LocalKey {
@override
String
toString
()
{
if
(
runtimeType
==
ObjectKey
)
return
'[
${value.runtimeType}
@
${value.hashCode}
]'
;
return
'[
$runtimeType
${value.runtimeType}
@
${value.hashCode}
]'
;
return
'[
${value.runtimeType}
#
${value.hashCode}
]'
;
return
'[
$runtimeType
${value.runtimeType}
#
${value.hashCode}
]'
;
}
}
...
...
@@ -309,9 +309,10 @@ class LabeledGlobalKey<T extends State<StatefulWidget>> extends GlobalKey<T> {
@override
String
toString
()
{
String
tag
=
_debugLabel
!=
null
?
'
$_debugLabel
'
:
'#
$hashCode
'
;
if
(
this
.
runtimeType
==
LabeledGlobalKey
)
return
'[GlobalKey
${_debugLabel ?? hashCode}
]'
;
return
'[
$runtimeType
${_debugLabel ?? hashCode}
]'
;
return
'[GlobalKey
$tag
]'
;
return
'[
$runtimeType
$tag
]'
;
}
}
...
...
@@ -341,7 +342,7 @@ class GlobalObjectKey<T extends State<StatefulWidget>> extends GlobalKey<T> {
int
get
hashCode
=>
identityHashCode
(
value
);
@override
String
toString
()
=>
'[
$runtimeType
${value.runtimeType}
@
${value.hashCode}
]'
;
String
toString
()
=>
'[
$runtimeType
${value.runtimeType}
#
${value.hashCode}
]'
;
}
/// This class is a work-around for the "is" operator not accepting a variable value as its right operand
...
...
@@ -1040,7 +1041,7 @@ abstract class State<T extends StatefulWidget> {
String
toString
()
{
final
List
<
String
>
data
=
<
String
>[];
debugFillDescription
(
data
);
return
'
$runtimeType
(
${data.join("; ")}
)'
;
return
'
$runtimeType
#
$hashCode
(
${data.join("; ")}
)'
;
}
/// Add additional information to the given description for use by [toString].
...
...
@@ -1055,7 +1056,6 @@ abstract class State<T extends StatefulWidget> {
@protected
@mustCallSuper
void
debugFillDescription
(
List
<
String
>
description
)
{
description
.
add
(
'
$hashCode
'
);
assert
(()
{
if
(
_debugLifecycleState
!=
_StateLifecycle
.
ready
)
description
.
add
(
'
$_debugLifecycleState
'
);
...
...
packages/flutter/lib/src/widgets/overlay.dart
View file @
0d81bdf5
...
...
@@ -150,7 +150,7 @@ class OverlayEntry {
}
@override
String
toString
()
=>
'
$runtimeType
@
$hashCode
(opaque:
$opaque
; maintainState:
$maintainState
)'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
(opaque:
$opaque
; maintainState:
$maintainState
)'
;
}
class
_OverlayEntry
extends
StatefulWidget
{
...
...
packages/flutter/test/foundation/service_extensions_test.dart
View file @
0d81bdf5
...
...
@@ -4,7 +4,6 @@
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
show
Platform
;
import
'dart:typed_data'
;
import
'dart:ui'
as
ui
;
...
...
@@ -124,13 +123,15 @@ void main() {
result
=
await
binding
.
testExtension
(
'debugDumpRenderTree'
,
<
String
,
String
>{});
expect
(
result
,
<
String
,
String
>{});
expect
(
console
,
<
String
>[
'RenderView
\n
'
' debug mode enabled -
${Platform.operatingSystem}
\n
'
' window size: Size(800.0, 600.0) (in physical pixels)
\n
'
' device pixel ratio: 1.0 (physical pixels per logical pixel)
\n
'
' configuration: Size(800.0, 600.0) at 1.0x (in logical pixels)
\n
'
'
\n
'
expect
(
console
,
<
Matcher
>[
matches
(
r'RenderView#[0-9]+\n'
r' debug mode enabled - [a-zA-Z]+\n'
r' window size: Size\(800\.0, 600\.0\) \(in physical pixels\)\n'
r' device pixel ratio: 1\.0 \(physical pixels per logical pixel\)\n'
r' configuration: Size\(800\.0, 600\.0\) at 1\.0x \(in logical pixels\)\n'
r'\n'
),
]);
console
.
clear
();
});
...
...
packages/flutter/test/painting/decoration_test.dart
View file @
0d81bdf5
...
...
@@ -75,7 +75,7 @@ class BackgroundImageProvider extends ImageProvider<BackgroundImageProvider> {
}
@override
String
toString
()
=>
'
$runtimeType
(
$hashCode
)'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
(
)'
;
}
class
TestImage
extends
ui
.
Image
{
...
...
packages/flutter/test/widgets/image_resolution_test.dart
View file @
0d81bdf5
...
...
@@ -78,7 +78,7 @@ class TestAssetBundle extends CachingAssetBundle {
}
@override
String
toString
()
=>
'
$runtimeType
@
$hashCode
()'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
()'
;
}
class
TestAssetImage
extends
AssetImage
{
...
...
packages/flutter/test/widgets/image_test.dart
View file @
0d81bdf5
...
...
@@ -291,12 +291,12 @@ void main() {
TestImageProvider
imageProvider
=
new
TestImageProvider
();
await
tester
.
pumpWidget
(
new
Image
(
image:
imageProvider
));
State
<
Image
>
image
=
tester
.
state
/*State<Image>*/
(
find
.
byType
(
Image
));
expect
(
image
.
toString
(),
matches
(
new
RegExp
(
r'_ImageState
\([0-9]+;
stream: ImageStream\(OneFrameImageStreamCompleter; unresolved; 1 listener\); pixels: null\)'
)));
expect
(
image
.
toString
(),
matches
(
new
RegExp
(
r'_ImageState
#[0-9]+\(
stream: ImageStream\(OneFrameImageStreamCompleter; unresolved; 1 listener\); pixels: null\)'
)));
imageProvider
.
complete
();
await
tester
.
pump
();
expect
(
image
.
toString
(),
matches
(
new
RegExp
(
r'_ImageState
\([0-9]+;
stream: ImageStream\(OneFrameImageStreamCompleter; \[100×100\] @ 1\.0x; 1 listener\); pixels: \[100×100\] @ 1\.0x\)'
)));
expect
(
image
.
toString
(),
matches
(
new
RegExp
(
r'_ImageState
#[0-9]+\(
stream: ImageStream\(OneFrameImageStreamCompleter; \[100×100\] @ 1\.0x; 1 listener\); pixels: \[100×100\] @ 1\.0x\)'
)));
await
tester
.
pumpWidget
(
new
Container
());
expect
(
image
.
toString
(),
matches
(
new
RegExp
(
r'_ImageState
\([0-9]+;
_StateLifecycle.defunct; not mounted; stream: ImageStream\(OneFrameImageStreamCompleter; \[100×100\] @ 1\.0x; 0 listeners\); pixels: \[100×100\] @ 1\.0x\)'
)));
expect
(
image
.
toString
(),
matches
(
new
RegExp
(
r'_ImageState
#[0-9]+\(
_StateLifecycle.defunct; not mounted; stream: ImageStream\(OneFrameImageStreamCompleter; \[100×100\] @ 1\.0x; 0 listeners\); pixels: \[100×100\] @ 1\.0x\)'
)));
});
}
...
...
@@ -324,7 +324,7 @@ class TestImageProvider extends ImageProvider<TestImageProvider> {
}
@override
String
toString
()
=>
'
$runtimeType
(
$hashCode
)'
;
String
toString
()
=>
'
$runtimeType
#
$hashCode
(
)'
;
}
class
TestImage
extends
ui
.
Image
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment