flutter_sudoku/lib/models/game_rank_dto.dart

21 lines
560 B
Dart
Raw Normal View History

2025-11-07 17:07:22 +09:00
// lib/models/game_rank_dto.dart
class GameRankDto {
final String playerName;
2025-11-10 18:02:01 +09:00
final int primaryScore; // 시간 (초)
final int? secondaryScore; // 점수 (저장된 값, 예: 0~4)
2025-11-07 17:07:22 +09:00
2025-11-10 18:02:01 +09:00
GameRankDto({
required this.playerName,
required this.primaryScore,
this.secondaryScore
});
2025-11-07 17:07:22 +09:00
factory GameRankDto.fromJson(Map<String, dynamic> json) {
return GameRankDto(
playerName: json['playerName'],
primaryScore: (json['primaryScore'] as num).toInt(),
2025-11-10 18:02:01 +09:00
secondaryScore: (json['secondaryScore'] as num?)?.toInt(),
2025-11-07 17:07:22 +09:00
);
}
}