close method
释放底层客户端、连接池、回调等资源
Implementation
@override
Future<void> close() async {
for (final token in _cancelCallbacks.keys.toList()) {
final callback = _cancelCallbacks.remove(token);
if (callback != null) {
token.removeCallback(callback);
}
}
_cancelTokenMap.clear();
_cancelTokenRefs.clear();
_interceptors.clear();
_baseOptions = null;
_dio.close(force: true);
}