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
f5834c9a
Commit
f5834c9a
authored
Oct 05, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more debugging information to Widgets.
Also, fix comment mentioning syncConstructorArguments.
parent
02535f50
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+12
-0
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+11
-4
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-1
No files found.
packages/flutter/lib/src/widgets/basic.dart
View file @
f5834c9a
...
...
@@ -712,6 +712,11 @@ class DefaultTextStyle extends InheritedWidget {
}
bool
updateShouldNotify
(
DefaultTextStyle
old
)
=>
style
!=
old
.
style
;
void
debugFillDescription
(
List
<
String
>
description
)
{
super
.
debugFillDescription
(
description
);
'
$style
'
.
split
(
'
\n
'
).
forEach
(
description
.
add
);
}
}
class
Text
extends
StatelessComponent
{
...
...
@@ -738,6 +743,13 @@ class Text extends StatelessComponent {
text
=
new
StyledTextSpan
(
combinedStyle
,
[
text
]);
return
new
Paragraph
(
text:
text
);
}
void
debugFillDescription
(
List
<
String
>
description
)
{
super
.
debugFillDescription
(
description
);
description
.
add
(
'"
$data
"'
);
if
(
style
!=
null
)
'
$style
'
.
split
(
'
\n
'
).
forEach
(
description
.
add
);
}
}
class
Image
extends
LeafRenderObjectWidget
{
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
f5834c9a
...
...
@@ -182,10 +182,15 @@ abstract class Widget {
Element
createElement
();
String
toString
()
{
if
(
key
==
null
)
return
'
$runtimeType
'
;
return
'
$runtimeType
-
$key
'
;
}
final
String
name
=
key
==
null
?
'
$runtimeType
'
:
'
$runtimeType
-
$key
'
;
final
List
<
String
>
data
=
<
String
>[];
debugFillDescription
(
data
);
if
(
data
.
isEmpty
)
return
'name'
;
return
'name(
${data.join("; ")}
)'
;
}
void
debugFillDescription
(
List
<
String
>
description
)
{
}
}
/// RenderObjectWidgets provide the configuration for [RenderObjectElement]s,
...
...
@@ -786,6 +791,8 @@ abstract class Element<T extends Widget> implements BuildContext {
description
.
add
(
'no depth'
);
if
(
widget
==
null
)
description
.
add
(
'no widget'
);
else
widget
.
debugFillDescription
(
description
);
}
String
toStringDeep
([
String
prefixLineOne
=
''
,
String
prefixOtherLines
=
''
])
{
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
f5834c9a
...
...
@@ -318,7 +318,7 @@ class ScrollableViewportState extends ScrollableState<ScrollableViewport> {
});
}
void
_updateScrollBehaviour
()
{
// if you don't call this from build()
or syncConstructorArguments()
, you must call it from setState().
// if you don't call this from build(), you must call it from setState().
scrollTo
(
scrollBehavior
.
updateExtents
(
contentExtent:
_childSize
,
containerExtent:
_viewportSize
,
...
...
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