Lambda Function in Dart
They are the short way of representing a function in Dart. They are also called arrow function. But you should note that with lambda function you can return value for only one expression.
Example: Lambda function in dart.
// Lambda function in Dart
void gfg() => print("Welcome to w3wiki");
void main()
{
// Calling Lambda function
gfg();
}
Output:
Welcome to w3wiki
Dart – Functions
The function is a set of statements that take inputs, do some specific computation and produces output. Functions are created when certain statements are repeatedly occurring in the program and a function is created to replace them. Functions make it easy to divide the complex program into smaller sub-groups and increase the code reusability of the program.