Find height of widget before layout - flutter

Is there any method/function which takes widget as input and returns its numerical height without building it.
Or even if it builds the widget but widget is not shown then it's fine.
There is this post:
How to get height of a Widget?
I can't seem to figure out how it works, so any example which still works in latest flutter would be very helpful.
My current condtion is described in flutter : Create scrollable organic gridview with dynamic height
I've solved most of it only dynamic height problem remains.

Related

Why is expanded widget is destroying my UI in flutter after publishing it on play store

I have developed an application in Flutter Dart and used an Expanded widget in my application but wherever I used expanded widget, it destroyed my UI and converted that List into an infinite list with no data on it.
Please let me know that reason why does this occur and the potential solution.
Thank you everyone in advance
You can use the expanded widget inside the column and row. Sometimes with use of an expanded widget with the wrong widget will give the error in release mode while it is working in the debug mode.
Make sure you are using the expanded widget inside the column or row and that column and row should not be inside the scroll view or other scrollable widgets.
If still not clear then update the question with the widget hierarchy.

How can I get the height of a flutter widget?

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.
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

Force Render in Flutter

Widgets like PreferredSize or SliverAppBar.expandedHeight need an actual height number to work, but sometimes I want that height to be the height of another Widget that hasn't been rendered yet, so it's height is unknown.
I would like then to simulate the Flutter Framework itself and falsely render a copy of that widget, so I could grab it's size and them use it on the first time my build function runs.
How can this be done?

Adding Semantics to the first widget on every page with Flutter

Google Play warns me about missing Content labeling under Accessibility tests for every page the crawler can reach.
I've tried to add a Semantics Widget to every page to surround the body element of the scaffold, I've even added an Extra Container as the first child of this Semantics widget with double.infinity as width and height.
The only other thing I can think of doing is to make it the parent of the Scaffold - but what is the correct solution?
Somewhat related: Should SafeArea be the parent or the body element of the Scaffold?
Concerning the placement of the safearea, you should always put your scaffold first. In other words, wrap the safearea with the scaffold. The content label error from play console can also be solved by specifying information such as hint text in input fields or labels for buttons where necessary.

how to zoom in & out in GWT

i created a widget, say MyBox, which has many other widgets. i have to use that widget on different page, however on different page, the size of the widget is different, on some page it's smaller, on other page it's bigger. Just wonder is there any way in GWT to zoom in & out the widget? Thanks
You can set the width and height of a widget, and the normal kinds of "zooming" that happen with HTML will happen to your widget too. If you want inner widgets to resize automatically, check out Layout Panels in GWT 2.0 and later.