Unverified Commit fac051c7 authored by Jacob Richman's avatar Jacob Richman Committed by GitHub

Fix bug in diagnostics for UnconstrainedBox class. (#27381)

parent b685a3ea
...@@ -2068,8 +2068,8 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget { ...@@ -2068,8 +2068,8 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget {
void debugFillProperties(DiagnosticPropertiesBuilder properties) { void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties); super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<AlignmentGeometry>('alignment', alignment)); properties.add(DiagnosticsProperty<AlignmentGeometry>('alignment', alignment));
properties.add(DiagnosticsProperty<Axis>('constrainedAxis', null)); properties.add(EnumProperty<Axis>('constrainedAxis', constrainedAxis, defaultValue: null));
properties.add(DiagnosticsProperty<TextDirection>('textDirection', textDirection, defaultValue: null)); properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
} }
} }
......
...@@ -145,6 +145,17 @@ void main() { ...@@ -145,6 +145,17 @@ void main() {
expect(_pointerDown, isTrue); expect(_pointerDown, isTrue);
}); });
}); });
test('UnconstrainedBox toString', () {
expect(
const UnconstrainedBox(constrainedAxis: Axis.vertical,).toString(),
equals('UnconstrainedBox(alignment: center, constrainedAxis: vertical)'),
);
expect(
const UnconstrainedBox(constrainedAxis: Axis.horizontal, textDirection: TextDirection.rtl, alignment: Alignment.topRight).toString(),
equals('UnconstrainedBox(alignment: topRight, constrainedAxis: horizontal, textDirection: rtl)'),
);
});
} }
HitsRenderBox hits(RenderBox renderBox) => HitsRenderBox(renderBox); HitsRenderBox hits(RenderBox renderBox) => HitsRenderBox(renderBox);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment