Period.fromJson constructor

Period.fromJson(
  1. Object? json
)

Implementation

factory Period.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return Period(
    end: map['end'] == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch((map['end'] as int).toInt()),
    start: map['start'] == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch((map['start'] as int).toInt()),
  );
}