class RegularizationLogModel { final String name; final String role; final DateTime? checkIn; final DateTime? checkOut; final int activity; RegularizationLogModel({ required this.name, required this.role, this.checkIn, this.checkOut, required this.activity, }); factory RegularizationLogModel.fromJson(Map json) { return RegularizationLogModel( name: "${json['firstName'] ?? ''} ${json['lastName'] ?? ''}".trim(), role: json['jobRoleName'] ?? '', checkIn: json['checkInTime'] != null ? DateTime.tryParse(json['checkInTime']) : null, checkOut: json['checkOutTime'] != null ? DateTime.tryParse(json['checkOutTime']) : null, activity: json['activity'] ?? 0, ); } }