flutter_sudoku/lib/models/game_rank_dto.dart
2025-11-10 18:02:01 +09:00

21 lines
560 B
Dart

// lib/models/game_rank_dto.dart
class GameRankDto {
final String playerName;
final int primaryScore; // 시간 (초)
final int? secondaryScore; // 점수 (저장된 값, 예: 0~4)
GameRankDto({
required this.playerName,
required this.primaryScore,
this.secondaryScore
});
factory GameRankDto.fromJson(Map<String, dynamic> json) {
return GameRankDto(
playerName: json['playerName'],
primaryScore: (json['primaryScore'] as num).toInt(),
secondaryScore: (json['secondaryScore'] as num?)?.toInt(),
);
}
}