Initial commit with gitignore
This commit is contained in:
16
lib/models/player.dart
Normal file
16
lib/models/player.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class Player {
|
||||
final String name;
|
||||
final Set<String> positions;
|
||||
|
||||
Player({required this.name, required this.positions});
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
'name': name,
|
||||
'positions': positions.toList(),
|
||||
};
|
||||
|
||||
factory Player.fromMap(Map<String, dynamic> map) => Player(
|
||||
name: (map['name'] ?? '').toString(),
|
||||
positions: Set<String>.from(map['positions'] ?? const []),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user