Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Created May 11, 2023 15:32
Show Gist options
  • Save salihgueler/f38d391d41d32c2c786b155952d9a278 to your computer and use it in GitHub Desktop.
Save salihgueler/f38d391d41d32c2c786b155952d9a278 to your computer and use it in GitHub Desktop.
void main() {
const friends = [
Friend('Salih', 'D\'artagnan', 'Guler'),
Friend('Abdallah', 'Solution', 'Shaban'),
Friend('Mo', 'Wise', 'Malaka')
];
for (final Friend(:name, :nickname, :surname) in friends) {
print('$name the $nickname $surname!');
}
}
class Friend {
const Friend(
this.name,
this.nickname,
this.surname,
);
final String name;
final String nickname;
final String surname;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment