SSEClient class

SSE 客户端 用于建立和维护 Server-Sent Events 连接

Constructors

SSEClient({required String baseUrl, required String path, String method = 'GET', Map<String, String>? queryParameters, dynamic data, Map<String, String>? staticHeaders, Future<Map<String, String>> dynamicHeaderBuilder()?, Map<String, String>? headers})

Properties

baseUrl String
final
data → dynamic
final
dynamicHeaderBuilder Future<Map<String, String>> Function()?
final
events Stream<SSEEvent>
获取事件流
no setter
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
final
isClosed bool
连接是否已关闭
no setter
isConnected bool
是否已连接
no setter
method String
final
path String
final
queryParameters Map<String, String>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
staticHeaders Map<String, String>?
final

Methods

close() Future<void>
关闭连接
connect() Future<void>
建立连接
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