mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix formatting of Flex error message (#16498)
This commit is contained in:
parent
0260642fc5
commit
1c3f6a851f
@ -681,7 +681,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
if (node != null) {
|
||||
information.writeln('The nearest ancestor providing an unbounded width constraint is:');
|
||||
information.write(' ');
|
||||
information.write(node.toStringShallow(joiner: '\n '));
|
||||
information.writeln(node.toStringShallow(joiner: '\n '));
|
||||
}
|
||||
information.writeln('See also: https://flutter.io/layout/');
|
||||
addendum = information.toString();
|
||||
|
@ -110,4 +110,34 @@ void main() {
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('Error information is printed correctly', (WidgetTester tester) async {
|
||||
// We run this twice, the first time without an error, so that the second time
|
||||
// we only get a single exception. Otherwise we'd get two, the one we want and
|
||||
// an extra one when we discover we never computed a size.
|
||||
await tester.pumpWidget(
|
||||
new Column(
|
||||
children: <Widget>[
|
||||
new Column(),
|
||||
],
|
||||
),
|
||||
Duration.zero,
|
||||
EnginePhase.layout,
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
new Column(
|
||||
children: <Widget>[
|
||||
new Column(
|
||||
children: <Widget>[
|
||||
new Expanded(child: new Container()),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Duration.zero,
|
||||
EnginePhase.layout,
|
||||
);
|
||||
final String message = tester.takeException().toString();
|
||||
expect(message, contains('\nSee also:'));
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user