fromJson static method
Returns a new RaidLeaderboardEntrySchema instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static RaidLeaderboardEntrySchema? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'position'),
'Required key "RaidLeaderboardEntrySchema[position]" is missing from JSON.');
assert(json[r'position'] != null,
'Required key "RaidLeaderboardEntrySchema[position]" has a null value in JSON.');
assert(json.containsKey(r'account'),
'Required key "RaidLeaderboardEntrySchema[account]" is missing from JSON.');
assert(json[r'account'] != null,
'Required key "RaidLeaderboardEntrySchema[account]" has a null value in JSON.');
assert(json.containsKey(r'points'),
'Required key "RaidLeaderboardEntrySchema[points]" is missing from JSON.');
assert(json[r'points'] != null,
'Required key "RaidLeaderboardEntrySchema[points]" has a null value in JSON.');
return true;
}());
return RaidLeaderboardEntrySchema(
position: mapValueOfType<int>(json, r'position')!,
account: mapValueOfType<String>(json, r'account')!,
points: mapValueOfType<int>(json, r'points')!,
);
}
return null;
}