flutter how to get size of widgets before building - flutter

I'd like to fit multiple widgets into PageView,
if the page is full, I want to move to the next page.
So I'd like to get sizes of the widgets inside the page without building the widgets.
This post seems that it's required to build the widget first before getting the size.
For text, I can do it using RenderParagraph.
Is it possible to get the size of custom widgets?
The widgets I want to get the size are basically text which we can tab each word.

Related

Flutter - web app - what's the best practice for displaying a modal data entry form?

I'm building a web app with Flutter, and I was wondering what the best options are for displaying a modal data entry form that does not need to take the whole screen space.
Initially, I was looking at pushing another Scaffold based screen, but that takes up the whole screen space.
Any suggestions?
My humble solution is to wrap your Scaffold's body's Widgets in a Stack.
You can choose whether or not to display the form using if (someState) ... inside the children list.
The form itself can be wrapped in a Card that is wrapped in a Center Widget.
There might be better solutions but that's what I use.

How to scale down a widget to display an overview in a grid view?

In my Flutter app, the user can create and edit multiple pages that are displayed in a PageView. The user can see one page at a time. Now I want to show an overview of all pages by shrinking the widgets and showing them in a Wrap layout widget.
I've tried this with the Transform.scale widget, but this keeps the original size of the page and just displays the child widget at a lower scale.Therefore this does not bring the desired effect in a wrap layout.

Large Form Layout for Flutter Web

I have to develop registration form in flutter which is very big but I am unable to implement it with the help of Flutter. This form is for a website. I am using TextFormField and I am unable to make it responsive.
You have to use a form and in that form you put a column that contain rows in every row you put textfieldform or two as I saw I the screenshot and you should wrap the textfieldforms with the expanded widget and do not forget to use MainAxisAlignment and crossAxisAlignment to adjust your widgets inside the column and the rows and that should be what you need to do.

Flutter: Change location injection in widget tree of DropDownMenuItem

I am using a DropdownButton in a Flutter app, and when you click it and the drop down appears, it overlays a webview that I'm using.
That all works perfectly, however webviews in Flutter, when run as a web app (which this is) trap all UI interactions and don't allow clicks to flow through to the Flutter UI elements.
There is a PointerInterceptor component that handles this perfectly, all I need to be able to do is wrap all of the DropdownMenuItems that appear inside of a single pointer interceptor (because if I individually wrap them then there is a really bad performance hit).
However - the DropdownMenuItems appear in the widget tree directly under the MaterialApp widget - and that is too high in the tree for me to wrap in a PointerInterceptor.
That is the reason that I want to know :
Is it possible to specify where in the widget tree the DropdownMenuItem widgets' appear when a DropdownMenuButton is clicked ?

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.