Programming in Dart: Functions & Closures

Jun 21 2022 Dart 2.16, Flutter, DartPad

Part 1: Meet the Function

5. Challenge: Create a Function

Lesson Complete

Play Next Lesson
Next
Save for later
About this episode
See forum comments
Cinema mode Mark as Complete Download course materials
Previous episode: 4. Understand Named Parameters Next episode: 6. Store a Function

This video was last updated on Jun 21 2022

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

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

At this point, you should feel pretty good idea about working with functions. So naturally, I have a challenge with you. In this episode, you’re going to get three challenges. So let’s get started.

String youAreWonderful
String youAreWonderful(String name) {

}
return 'You are wonderful, $name';
print(youAreWonderful('Douglas'));
String youAreWonderful(String name, int numberOfPeople) {
return 'You are wonderful, $name. $numberOfPeople people think so.';
print(youAreWonderful('Douglas', 10));
String youAreWonderful({ String name, int numberOfPeople } ) 
String youAreWonderful({ required String name, int numberOfPeople } ) 
String youAreWonderful({ required String name, int numberOfPeople = 30} ) 
print(youAreWonderful(name: 'Douglas', numberOfPeople: 10));
print(youAreWonderful(name: 'Jeremy'));