0

I'm trying to build my first flutter app for study purpose. I don't know why a component is not appearing in the screen.

My code:

enter image description here enter image description here

enter image description here

enter image description here

Am I doing something wrong? As you can see buildAirportSelector() is called twice, only one of them is on the screen.

Thank you in advance

JamesThiago
  • 33
  • 1
  • 8
  • 1
    Hi, please paste more code (entire file), instead of screenshots. Right now I have no idea what all your class variables mean (e.g. searchTextFieldIn, searchTextieldOut, but most importantly we can't see how your isLoading variable gets updated.) – zabson Apr 30 '20 at 20:34
  • Hi @zabson. Thank you for your interest in help me. I didn't put all the code because it's not usually a culture here, the code is too big. If it's not a big problem, I can provide all the code. I updated with some more information putting the necessary information. Thanks! – JamesThiago Apr 30 '20 at 22:07
  • Can't really tell where the bug would be. Consider the following things though. Future builder to show your loading and result widgets. You don't need to make an http call in init state and you don't have to maintain an isLoading variable, which in turn you have to call setState to rebuild your tree again: https://api.flutter.dev/flutter/widgets/FutureBuilder-class.html Divider: https://www.youtube.com/watch?v=_liUC641Nmk Using const for Widgets you don't want to rebuild: https://stackoverflow.com/questions/53492705/does-using-const-in-the-widget-tree-improve-performance – zabson May 01 '20 at 12:56

0 Answers0