You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 KiB

4 years ago
import 'package:json_annotation/json_annotation.dart';
/// pageNum : 1
/// pageSize : 10
/// size : 0
/// pages : 0
/// hasPreviousPage : false
/// hasNextPage : false
/// total : "0"
/// list : []
class Page<T> {
Page();
int pageNum;
int pageSize;
int size;
int pages;
bool hasPreviousPage;
bool hasNextPage;
int total;
List<T> list;
// Page fromJson(Map<String, dynamic> json) {
// return Page()
// ..hasNextPage = json['hasNextPage'] as bool
// ..hasPreviousPage = json['hasPreviousPage'] as bool
// ..list = (json['list'] as List)
// ?.map(
// (e) => e == null ? null : T.fromJson(e as Map<String, dynamic>))
// ?.toList()
// ..pageNum = json['pageNum'] as int
// ..pageSize = json['pageSize'] as int
// ..pages = json['pages'] as int
// ..size = json['size'] as int
// ..total = json['total'] as int;
// }
//
// toJson(Page instance) =>
// <String, dynamic>{
// 'hasNextPage': instance.hasNextPage,
// 'hasPreviousPage': instance.hasPreviousPage,
// 'list': instance.list.map((e) => e.toJson()),
// 'pageNum': instance.pageNum,
// 'pageSize': instance.pageSize,
// 'pages': instance.pages,
// 'size': instance.size,
// 'total': instance.total,
// };
}