Overview of Callbacks in Flutter
Learn what callbacks are in Flutter and how you can pass functions through callbacks.
We'll cover the following
We will discuss two things in this lesson. First, we will learn what a callback is.
Then, we’ll explore how to pass a function in Flutter.
In addition to these questions, we’ll also try to understand callback.
Definition of callbacks
In computer programming, we pass functions as arguments to other code. Functions that’re passed as arguments are called callbacks.
Other code in the application can call back or execute the argument when it is needed.
Let’s see how callbacks work in Flutter.
In a stateful widget, consider a function like this:
Get hands-on with 1400+ tech skills courses.