mchess-client/lib/api/register.dart
2024-05-19 17:22:06 +02:00

24 lines
484 B
Dart

class CreateGameResponse {
final String? passphrase;
const CreateGameResponse({
required this.passphrase,
});
factory CreateGameResponse.empty() {
return const CreateGameResponse(passphrase: null);
}
factory CreateGameResponse.fromJson(Map<String, dynamic> json) {
final passphrase = json['passphrase'];
return CreateGameResponse(passphrase: passphrase);
}
Map<String, dynamic> toJson() {
return {
'passphrase': passphrase,
};
}
}