Files
syncrow-web/lib/pages/spaces_management/model/space_response_model.dart
2024-10-11 10:35:14 +04:00

40 lines
926 B
Dart

import 'space_model.dart';
class SpacesResponse {
final List<SpaceModel> data;
final String message;
final int page;
final int size;
final int totalItem;
final int totalPage;
final bool hasNext;
final bool hasPrevious;
SpacesResponse({
required this.data,
required this.message,
required this.page,
required this.size,
required this.totalItem,
required this.totalPage,
required this.hasNext,
required this.hasPrevious,
});
factory SpacesResponse.fromJson(Map<String, dynamic> json) {
return SpacesResponse(
data: (json['data'] as List)
.map((jsonItem) => SpaceModel.fromJson(jsonItem))
.toList(),
message: json['message'],
page: json['page'],
size: json['size'],
totalItem: json['totalItem'],
totalPage: json['totalPage'],
hasNext: json['hasNext'],
hasPrevious: json['hasPrevious'],
);
}
}