ResponseDataConfig class
响应数据格式化配置
Constructors
- ResponseDataConfig({String codeField = 'code', String messageField = 'message', String dataField = 'data', List? successCodes, bool autoParse = true})
- ResponseDataConfig.custom({required String codeField, required String messageField, required String dataField, List? successCodes, bool autoParse = true})
-
创建自定义配置
factory
- ResponseDataConfig.standard()
-
创建默认配置(标准格式)
factory
Properties
- autoParse → bool
-
是否自动解析响应并提取data字段
final
- codeField → String
-
响应中的code字段名,默认为 'code'
final
- dataField → String
-
响应中的data字段名,默认为 'data'
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- messageField → String
-
响应中的message字段名,默认为 'message'
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- successCodes → List
-
成功的code列表,默认为
200, 0final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited