leaderType property
List<SegmentLeaderboardType> ?
leaderType
Returns the value of the leaderType field. Returns null if the field is not defined in the message.
Implementation
List<SegmentLeaderboardType>? get leaderType {
final field = getField(SegmentFileLeaderTypeField.ID);
if (field != null && field.isValid()) {
final values = field.getValues();
return values
.map((item) => SegmentLeaderboardTypeExt.fromValue(item))
.toList();
} else {
return null;
}
}
Sets the leaderType field with value
. Throws FieldNotDefinedError
if the field is not defined in the message.
Implementation
set leaderType(List<SegmentLeaderboardType>? value) {
final field = getField(SegmentFileLeaderTypeField.ID);
if (field != null) {
if (value == null) {
field.clear();
} else {
final values = value.map((item) => item.value).toList();
field.setValues(values);
}
} else {
throw FieldNotDefinedError(field!.name);
}
}