Flutter: how to perform action after the build of a widget is completed?

In Flutter, sometimes you want to perform an action after the build process of a widget is completed. For example, you may need to update the view or start an animation once the widget is displayed on the screen. To achieve this, Flutter provides the addPostFrameCallback method, which allows you to execute a callback after the last frame of a widget’s build process is drawn. addPostFrameCallback is a method of the SchedulerBinding class, which is the central class that schedules tasks and controls the behavior of the framework....

July 14, 2023 · 2 min

Why you should use `const` constructor

Flutter development is based on the concept of Widget and on the creation of custom widgets to define the UI and behavior of your app. In this post, we’ll explore how using a const constructor for widgets can improve the performance of your Flutter app. When you create a Flutter widget, the framework creates an instance of that widget and stores it in memory. If the widget is rebuilt (for example, if the underlying data changes), a new instance is created and the old one is discarded....

July 13, 2023 · 2 min

How generative artificial intelligence can help you overcome getting stuck at work

Often in work, we find ourselves in a moment where we can’t seem to move forward. We end up staring at the screen, unsure of how to proceed with our work. This can happen to software developers who encounter a particularly difficult bug to solve or face complex choices in creating a software architecture. It can happen to a social media manager who needs to write a new post or to a writer who needs to start a new page....

July 8, 2023 · 2 min

Flutter StatefulWidget o FutureBuilder?

Nello sviluppo Flutter una necessità frequente è quella di implementare un Widget che si aggiorna in modo dinamico in base al risultato di una funzione. Per implementare un Widget che si aggiorna in base al risultato di una funzione asincrona, ovvero una funzione che ritorna un Future, esistono due modalità principali: utilizzare uno StatelessWidget con un FutureBuilder o utilizzare uno StatefulWidget. Nel caso dello StatelessWidget, il metodo build del Widget utilizza un FutureBuilder per gestire l’aggiornamento in base al risultato del Future....

June 19, 2023 · 2 min

How To Survive The Burnout - DroidCon Talk

At DroidCon Italy 2021, I presented my talk on burnout for the first time. What is burnout? According to the World Health Organization’s definition, burnout is a syndrome resulting from chronic workplace stress that has not been successfully managed. The talk is divided into two parts: a general introduction and a more specific focus on the world of software development. Feel free to leave your comments and suggestions for improving the talk!...

June 13, 2022 · 1 min