Set state when we are actually changing the state of the layout display (#1398)
diff --git a/packages/devtools_app/lib/src/inspector/flutter/story_of_your_layout/flex.dart b/packages/devtools_app/lib/src/inspector/flutter/story_of_your_layout/flex.dart index 2a2a11b..45e7bad 100644 --- a/packages/devtools_app/lib/src/inspector/flutter/story_of_your_layout/flex.dart +++ b/packages/devtools_app/lib/src/inspector/flutter/story_of_your_layout/flex.dart
@@ -478,11 +478,13 @@ // the type is dependent on the `axis` parameter // if the axis is the main axis the type should be [MainAxisAlignment] // if the axis is the cross axis the type should be [CrossAxisAlignment] - if (axis == direction) { - properties.mainAxisAlignment = newSelection; - } else { - properties.crossAxisAlignment = newSelection; - } + setState(() { + if (axis == direction) { + properties.mainAxisAlignment = newSelection; + } else { + properties.crossAxisAlignment = newSelection; + } + }); final service = await properties.node.inspectorService; final arg = properties.node.valueRef; await service.invokeTweakFlexProperties( @@ -490,7 +492,6 @@ properties.mainAxisAlignment, properties.crossAxisAlignment, ); - setState(() {}); }, ), ),