Skip to content

Instantly share code, notes, and snippets.

@jebright
Created September 23, 2018 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jebright/3ba27b44620f3f003fc05de65202c9be to your computer and use it in GitHub Desktop.
Save jebright/3ba27b44620f3f003fc05de65202c9be to your computer and use it in GitHub Desktop.
Dart Fundamentals - Lists - Map
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