Need some advice in how to optimize my app

I'm a newbie in app making, and after a lot of backtracking I'm just about to finish my first app.

But I wanted to know how I could've made these procedures in a faster and more efficient way.

There's actually more than 60 "if then" in this one Event Handler

There's also other 60 similar Event Handlers as this two


These two events word together


Thanks for your time!

You seem to have components in pairs, like

  • Caixas, Pcts
  • Caixas2, Pcts2
  • Caixas3, Pcts3

I don't see any place in your blocks where you use lists, or where you reuse a small number of components for a movable section of your lists.

Be aware that you can initialize global lists of components and iterate through them.

You can also pair up components in lists of lists, or in dictionaries, to let you apply dependency rules of color and height pair by pair in a loop.

It makes it easier to debug projects like this if the components follow a naming convention, with component name prefixes like

  • har: Horizontal Arrangement
  • lbl: Label
  • txb:Text Box

Some sample projects for you to read ...

https://groups.google.com/g/mitappinventortest/c/JJ4bMwWg-HU/m/PtuGOUcfDAAJ

2 Likes

Thank you very much! I'll be looking into all of it.