process method Null safety
- PipelineFlowItem item
override
Processes a PipelineFlowItem and returns a possibly modified PipelineFlowItem if the pipeline is to continue.
If the operation is acting as a filter null can be returned to cancel
the current Pipeline
execution
Implementation
@override
Future<PipelineFlowItem?> process(PipelineFlowItem item) async {
double mDistance = item.runnerTraveled.toDouble();
final length = Length(removeTrailingZeros: false);
length.convert(LENGTH.meters, mDistance);
final distance = (length.kilometers.value ?? 0).floor();
return item.copyWith(runnerCompletedKm: distance);
}