How can I get the height of a flutter widget? I think it's using key, but I don't know how. For example I want to get the height of a container, which will be in a stack to be able to put the padding of a list view and that at the initial moment it is under the container.
Asked
Active
Viewed 807 times
1
-
1https://stackoverflow.com/questions/49307677/how-to-get-a-height-of-a-widget – Omer Gamliel Aug 05 '20 at 10:39
-
Do you need the height before building the stack? In that case use a LayoutBuilder. – lenz Aug 05 '20 at 10:50
-
Does this answer your question? [How to get a height of a Widget?](https://stackoverflow.com/questions/49307677/how-to-get-a-height-of-a-widget) – Christopher Moore Aug 05 '20 at 16:10
1 Answers
0
If you’re wanting to get the height before the children widget are built, use a LayoutBuilder widget to wrap the descendants.
Otherwise you can also check the dev tools by using the Select Wifget tool and looking at the widget”s properties

lenz
- 2,193
- 17
- 31