Duration.fromJson constructor

Duration.fromJson(
  1. Object? j
)

Implementation

factory Duration.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Duration(
    nanos: switch (json['nanos']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    seconds: switch (json['seconds']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
  );
}