Add more debugging information to Widgets. Also, fix comment mentioning syncConstructorArguments.
diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index d5dbb44..22f7d3e 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart
@@ -712,6 +712,11 @@ } 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 @@ 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 {
diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index c0cce2b..efce9af 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart
@@ -182,10 +182,15 @@ 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 @@ description.add('no depth'); if (widget == null) description.add('no widget'); + else + widget.debugFillDescription(description); } String toStringDeep([String prefixLineOne = '', String prefixOtherLines = '']) {
diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index cf1693a..da4d940 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart
@@ -318,7 +318,7 @@ }); } 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,