Programming in Dart: Functions & Closures

Jun 21 2022 · Dart 2.16, Flutter, DartPad

Part 1: Meet the Function

08. Use Arrow Notation

Episode complete

Play next episode

About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 07. Understand Typedef Next episode: 09. Conclusion

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

Often times when you will write a function that is composed of a single line of code, you can actually shorthand to make a function a single line of code. You use what is known as arrow notation. It’s also known as fat arrow syntax or lambda syntax.

int add(int itemA, int itemB) {
    return itemA + itemB;
void main() {
    print(add(1, 2));
int add(int itemA, int itemB) => itemA + itemB;
void log(String message) => print(message);
void main() {
    log('this space is for rent');
void main() => log('this space is for rent');