Lambda Expression in Flutter — Functional Programming

Ankit dwivedi
1 min readDec 5, 2022

Hello folks, here we are discussing about the Lambda expression in Dart programming language.

What is Lambda expression?

Lambda expression is a function without a name, it is also called as anonymous function or just Lamda.

Dart is very cool programming language, it has lot of cool features and modern programming capabilities. Inside the dart, function is also a kind of an object as we define variables and objects in Dart.

Lambda Functions

Traditionally we define any function like this

we can convert same function in lambda function like this

As we know function in dart is an object so we can assign this function to object like

How to call Lambda functions

Call function variable name and pass the parameter to that object like

Write a function as expression

Further we can trim down the function into an expression, by using big fat arrow

this will print same result as previous function.

so that’s it guys, this is your lambda expression.

Thank you for reading :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Ankit dwivedi
Ankit dwivedi

Written by Ankit dwivedi

Software developer ? ( Flutter || Dart || IOS ||C# || Nodejs || Kotlin || Java || Android ) : Writing

No responses yet

Write a response