Anonymous and Nested Function
Get introduced to anonymous and nested functions in Dart and learn their syntax.
We'll cover the following
Function literals
Literals are defined as fixed values appearing directly in the source code. Literals don’t need to be named, they can simply be used directly.
There are times when we only need to use functions once, or temporarily, only requiring the functionality of those functions. Naming them is an extra unnecessary step in this scenario. What we need is something similar to literals. Functions that do not need to be named as their functionality is only required for a single instance.
Dart provides a solution known as anonymous functions.
Anonymous functions are sometimes known as lambda functions or closures.
Create a free account to access the full course.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy