TimeOfDay.fromJson constructor

TimeOfDay.fromJson(
  1. Object? j
)

Implementation

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