mchess-client/lib/api/register.dart

24 lines
484 B
Dart
Raw Normal View History

2024-05-19 15:22:06 +00:00
class CreateGameResponse {
2023-06-29 23:49:18 +00:00
final String? passphrase;
2023-06-02 21:28:40 +00:00
2024-05-19 15:22:06 +00:00
const CreateGameResponse({
2023-06-29 23:49:18 +00:00
required this.passphrase,
2023-06-02 21:28:40 +00:00
});
2024-05-19 15:22:06 +00:00
factory CreateGameResponse.empty() {
return const CreateGameResponse(passphrase: null);
}
2024-05-19 15:22:06 +00:00
factory CreateGameResponse.fromJson(Map<String, dynamic> json) {
2023-06-29 23:49:18 +00:00
final passphrase = json['passphrase'];
2023-06-02 21:28:40 +00:00
2024-05-19 15:22:06 +00:00
return CreateGameResponse(passphrase: passphrase);
2023-06-02 21:28:40 +00:00
}
2023-06-29 23:49:18 +00:00
Map<String, dynamic> toJson() {
return {
'passphrase': passphrase,
};
}
2023-06-02 21:28:40 +00:00
}