History.fromJson constructor

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

Implementation

factory History.fromJson(Map<String, dynamic> json) {
  var createdOn = DateTime.fromMillisecondsSinceEpoch(json['created_on']);

  final changes = json['changes']
      ?.map((c) => Changes.fromJson(c))
      .toList()
      .cast<Changes>();

  return History(
    changes: changes,
    createdOn: createdOn,
    id: json['id'],
    typeId: json['type_id'],
    userId: json['user_id'],
  );
}