import '../../Commitment.dart'; class CommitmentPage { int number; int size; int totalElements; int totalPages; int numberOfElements; bool first; bool last; List content; CommitmentPage({ this.number = 0, this.size = 0, this.totalElements = 0, this.totalPages = 0, this.numberOfElements = 0, this.first = true, this.last = true, List? content, }) : content = content ?? []; factory CommitmentPage.fromJson(Map json) { return CommitmentPage( number: json['number'] ?? 0, size: json['size'] ?? 0, totalElements: json['totalElements'] ?? 0, totalPages: json['totalPages'] ?? 0, numberOfElements: json['numberOfElements'] ?? 0, first: json['first'] ?? true, last: json['last'] ?? true, content: json['content'] == null ? [] : (json['content'] as List) .map((item) => Commitment.fromJson(item)) .toList(), ); } }