desc property

Implementation

FlowLogDesc get desc {
  int normalCount = 0;
  int errorCount = 0;
  for (var log in logs!) {
    if (log.type == LogType.log) {
      normalCount += 1;
    } else {
      errorCount += 1;
    }
  }
  var detail = '$normalCount Logs, $errorCount Errors';
  var duration = '';
  if (endAt != null) {
    duration = ", ${createdAt!.difference(endAt!).inMilliseconds * -1}ms";
  }
  return FlowLogDesc(
    detail: detail + duration,
    hasError: errorCount > 0,
    hasItem: (errorCount + errorCount) > 0,
  );
}