fromJson static method

GameHighScore? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static GameHighScore? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return GameHighScore(
    position: (json['position'] as int?) ?? 0,
    userId: (json['user_id'] as int?) ?? 0,
    score: (json['score'] as int?) ?? 0,
  );
}