Programming in Dart: Functions & Closures

Jun 21 2022 · Dart 2.16, Flutter, DartPad

Part 1: Meet the Function

02. Use Functions

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 01. Introduction Next episode: 03. Implement Optional Parameters

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’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

When working with any programming language, you will often hear the acronym, DRY. That is, do not repeat yourself.

void
void printName
void printName()
void printName(String name)
void printName(String name) {
  
}
void printName(String name) {
  print(name);
}
printName('Brian');
void printName(String name) {
  for (int i = 0; i < 5; i++) {
    print(name);
  }
}
void printName(String name, int repeat) {

}
printName('Brian', 10);
for (int i = 0; i < repeat; i++) {