I'm using the following code to get the size of a widget:
@override
Widget build(BuildContext context) {
RenderBox renderBox = context.findRenderObject();
Size size = renderBox.size;
}
However, when a rotation happens, it always returns the size of the previous orientation (for instance, if it rotates to landscape, it gives me the size of the portrait representation and vice versa). Is there a different way of getting the size of a widget on orientation change?

