PaginatedListParser<T> class

分页列表解析器 - 支持分页元数据解析 适用于格式: { "code": 200, "data": { "list": ..., "page": 1, "total": 100 }, "message": "success" }

Implemented types

Constructors

PaginatedListParser({String dataFieldName = NetworkConstants.fieldData, String listFieldName = 'list', required T itemParser(dynamic item), bool validateStatusCode = true, Map<String, String>? paginationFields})

Properties

dataFieldName String
数据字段名,默认为 'data'
final
hashCode int
The hash code for this object.
no setterinherited
itemParser → T Function(dynamic item)
子项解析器
final
listFieldName String
列表字段名,默认为 'list'
final
paginationFields Map<String, String>
分页字段映射
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validateStatusCode bool
是否验证状态码
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(dynamic rawData) PaginatedResult<T>
解析数据 rawData 原始响应数据 返回解析后的目标数据
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited