toJson method

dynamic toJson(
  1. dynamic value,
  2. TypeContext context
)
override

Implementation

toJson(dynamic value, TypeContext context) {
  Duration? duration = value is Duration ? value : null;
  if (duration == null) return null;
  return toTimeSpan(duration);
}