form_bloc icon indicating copy to clipboard operation
form_bloc copied to clipboard

Slow rendering with a lot of components as child

Open capriele opened this issue 4 years ago • 3 comments

Hello and many thanks for this awesome project! I'm writing a page that is basically based on this example:

https://giancarlocode.github.io/form_bloc/#/

(the Built-in Widget). The only difference is that in the example there are only 9 components as child, instead in mine there are 100 elements.

Is there a way to speed up the loading process?

Many thanks!

capriele avatar Apr 22 '20 19:04 capriele

:) Hello @capriele

Can you tell me the name of the example, the urls are bug for now :(.

Do you have a minimum example where I can see the error?

Do all your fields have validators?

I think it may be due to subscriptions to keep the form state up to date, maybe I can increase performance :)

GiancarloCode avatar Apr 22 '20 19:04 GiancarloCode

Yes, the name of the example is "Built-in Widget". (its source link is this: https://github.com/GiancarloCode/form_bloc/blob/master/form_bloc_web/lib/examples/all_fields_form.dart) You can reproduce the performance issue simply increasing the number of children (row 112: https://github.com/GiancarloCode/form_bloc/blob/master/form_bloc_web/lib/examples/all_fields_form.dart#L112)

Many thanks!

capriele avatar Apr 22 '20 20:04 capriele

@GiancarloCode I can update the post saying that this problem occurs only when you build the app. in debug mode. On a release version the problem vanishes.

capriele avatar Apr 23 '20 12:04 capriele