You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
504 B
22 lines
504 B
import 'package:bowl_in/database/fields/PlayerFields.dart';
|
|
|
|
import '../../model/Game.dart';
|
|
import '../../model/Player.dart';
|
|
|
|
class PlayerMapper {
|
|
static Map<String, dynamic> toJson(Player player, Game game) {
|
|
return {
|
|
PlayerFields.idGame: game.id,
|
|
PlayerFields.name: player.name,
|
|
PlayerFields.image: player.image,
|
|
};
|
|
}
|
|
|
|
static Player toModel(Map<String, dynamic> json) {
|
|
return Player(
|
|
json[PlayerFields.name],
|
|
json[PlayerFields.image]
|
|
);
|
|
}
|
|
}
|