create static method
Create a policy for dataType, throttled to throttleInterval.
Creation fails for a data type whose values cannot be compared for change.
Parameters
dataType: The data type this policy applies to. Required.throttleInterval: Minimum time between delivered updates. Duration.zero, or any non-positive duration, means no throttling. A positive duration shorter than one millisecond is raised to one millisecond. Defaults to Duration.zero.
Returns
- DiscreteDataDeliveryPolicy?: The created policy, or null if creation failed.
Implementation
static DiscreteDataDeliveryPolicy? create({
required DataType dataType,
Duration throttleInterval = Duration.zero,
}) {
final int? id = DataDeliveryPolicy._create(
'DiscreteDataDeliveryPolicy',
dataType,
);
if (id == null) {
return null;
}
final DiscreteDataDeliveryPolicy policy = DiscreteDataDeliveryPolicy.init(
id,
dataType,
);
if (throttleInterval != Duration.zero) {
policy.throttleInterval = throttleInterval;
}
return policy;
}