ResponseHandler class

Constructors

ResponseHandler()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

extractTypedValue<T>(Map<String, dynamic> json, List<String> keys) → T?
安全的数据提取方法
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateResponseData(Map<String, dynamic>? json) bool
验证响应数据的完整性

Operators

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

Static Methods

handleCancelError<T>(DioException exception, int statusCode) BaseResponse<T>
handleDioException<T>(DioException exception) BaseResponse<T>
handleError<T>(AppException exception) BaseResponse<T>
handleResponse<T>(Response response) BaseResponse<T>
处理响应数据
truncateMessage(String message) String
智能截断过长的消息,确保适合 Toast 显示 优先在句子边界(句号、问号、感叹号)处截断 其次在逗号、分号处截断 最后在空格处截断