Skip to content

Instantly share code, notes, and snippets.

@nitaking
Created October 30, 2023 05:29
Show Gist options
  • Save nitaking/3f4cc8636f64a6630742c6584678a296 to your computer and use it in GitHub Desktop.
Save nitaking/3f4cc8636f64a6630742c6584678a296 to your computer and use it in GitHub Desktop.
rustic-sunshine-3259

rustic-sunshine-3259

Created with <3 with dartpad.dev.

class User {
final int id;
final String name;
const User({
required this.id,
required this.name,
});
}
List<User> users = [
User( id: 1, name: 'yamada' ),
User( id: 2, name: 'suzuki' ),
User( id: 3, name: 'hogehoge')
];
void main(){
users.asMap().forEach((index, user){
print('index: $index, id: ${user.id}, name: ${user.name}');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment