AttendanceResponseModel.fromJson constructor

AttendanceResponseModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory AttendanceResponseModel.fromJson(Map<String, dynamic> json) {
  return AttendanceResponseModel(
    id: json["id"] ?? 0,
    date: json["date"],
    clock: json["clock"],
    clockGmt: json["clock_gmt"],
    type: attendanceClockTypeFromString(json['type']) ??
        AttendanceClockType.clockIn,
    image: json["image"] != null
        ? AttendanceImageModel.fromJson(json["image"])
        : null,
    latitude: double.parse('${json["latitude"] ?? 0}'),
    longitude: double.parse('${json["longitude"] ?? 0}'),
    address: json["address"],
    notes: json["notes"],
    scheduleClock: json["schedule_clock"],
    scheduleClockGmt: json["schedule_clock_gmt"],
    isLate: json["is_late"],
    files: json['files'] != null
        ? List<String>.from(json['files']).toList()
        : null,
    clockoutDuration: durationTimeParse(json['clockout_duration']) ??
        const Duration(seconds: 0),
    clockToleranceDuration:
        durationTimeParse(json['clockout_tolerance_duration']) ??
            const Duration(seconds: 0),
    trackerInterval: durationTimeParse(json['tracker_interval']) ??
        const Duration(minutes: 5),
    trackerConfig: TrackerConfigModel.fromJson(json['tracker_configuration']),
  );
}