ListDataParser<T> class
列表数据解析器 - 从响应中提取列表数据
适用于格式: { "code": 200, "data": {...}, {...}, "message": "success" }
- Implemented types
-
- DataParser<
List< T> >
- DataParser<
Constructors
- ListDataParser({String fieldName = NetworkConstants.fieldData, required T itemParser(dynamic item), bool validateStatusCode = true})
Properties
- fieldName → String
-
数据字段名,默认为 'data'
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemParser → T Function(dynamic item)
-
子项解析器,用于将列表中的每一项转换为目标类型
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) → List< T> -
解析数据
rawData原始响应数据 返回解析后的目标数据override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited