contentParameters property
ContentParameters?
get
contentParameters
Additional content-specific parameters if present.
Only a subset of content types include extra parameters (road maps, human voice packs and certain style packages). The returned object is a concrete subtype of ContentParameters.
The actual runtime type can be one of:
- RoadMapParameters for ContentType.roadMap
- VoiceParameters for ContentType.humanVoice
- StyleParameters for ContentType.viewStyleHighRes or ContentType.viewStyleLowRess
Returns
- A ContentParameters instance for available parameters, or
nullwhen none are present.
Implementation
ContentParameters? get contentParameters {
final OperationResult resultString = objectMethod(
pointerId,
'ContentStoreItem',
'getContentParameters',
);
if (resultString['gemApiError'] != 0) {
return null;
}
final List<GemParameter> params = SearchableParameterList.init(
resultString['result'],
).toList();
final Set<String> keys = <String>{
for (final GemParameter p in params)
if (p.key != null && p.key!.isNotEmpty) p.key!,
};
if (keys.contains('Copyright')) {
return RoadMapParameters.fromParameters(params);
}
if (keys.contains('native_language')) {
return VoiceParameters.fromParameters(params);
}
if (keys.contains('Background-Color')) {
return StyleParameters.fromParameters(params);
}
return null;
}