encodeString method

String? encodeString({
  1. bool asNanos = false,
})

Canonical "3.000001s" string form (null when empty). asNanos is accepted for generator compatibility and ignored.

Implementation

String? encodeString({bool asNanos = false}) {
  if (seconds == null && nanos == null) return null;
  return formatDuration(seconds, nanos);
}