WidgetsBinding's addPostFrameCallback [Flutter, Dart]

preview_player
Показать описание
Many of us had found a solution to certain #Flutter runtime crashes by using addPostFrameCallback method. An example of such a crash is "The showSnackBar() method cannot be called during build. Let's have a look at where are these callbacks called so that it fixes this kind of issue.

In short the callbacks are run after the current frame is done.
Рекомендации по теме