Flutter #day13

Photo by RetroSupply on Unsplash

Flutter #day13

ยท

1 min read

Started with a new project (BMI calculator) aiming to learn more about Flutter UI and themes.

  • ThemeData(): we can set our custom theme for the app using this class, we can explicitly define a lot of properties to make our app look and feel according to us.

  • Final vs const: both of these are immutable but the difference is that final is a runtime constant and const is a compile-time constant. ( we need to initialize the const variable during its declaration, while on the other hand, final variables can be initialized later as well.)

  • use of Flutter outline to extract ambiguous widgets: we can select any repetitive widget code and then go to Flutter outline to extract the widget into a separate class and we can just call the class to do the functionality wherever needed.

  • immutability: (stateless widgets are immutable, properties need to be set final)

ย