-
-
Save jebright/3ba27b44620f3f003fc05de65202c9be to your computer and use it in GitHub Desktop.
Dart Fundamentals - Lists - Map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
{ | |
String firstName; | |
String lastName; | |
Person(this.firstName, this.lastName); | |
} | |
void main() { | |
List<Person> people = new List<Person>(); | |
people.add(new Person("Joe", "Smithers")); | |
people.add(new Person("Patrick", "Thomas")); | |
var mappedNames = people.map((n) => 'Mr. ${n.firstName} ${n.lastName}'); | |
log(mappedNames); | |
} | |
void log(var lst) { | |
lst.forEach((n) => print(n)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment