Client class

Constructors

Client(String host, {dynamic securityContext, Duration? streamingConnectionTimeout, Duration? connectionTimeout, dynamic onFailedCall(MethodCallContext, Object, StackTrace)?, dynamic onSucceededCall(MethodCallContext)?, bool? disconnectStreamsOnLostInternetConnection, Client? httpClientOverride})

Properties

analytics ↔ EndpointAnalytics
latefinal
authKeyProvider ↔ ClientAuthKeyProvider?
Provides the authentication key for the client. Required to make authenticated requests. If not provided, all requests will be unauthenticated.
getter/setter pairinherited
connectionTimeout → Duration
Timeout when calling a server endpoint. If no response has been received, defaults to 20 seconds.
finalinherited
connectivityMonitor ↔ ConnectivityMonitor?
Set a connectivity monitor to better manage streaming connections. You can find the FlutterConnectivityMonitor in the serverpod_flutter package.
getter/setter pairinherited
emailIdp ↔ EndpointEmailIdp
latefinal
endpointRefLookup → Map<String, EndpointRef>
Looks up an EndpointRef by its name. This method is typically only used internally and overridden by generated code.
no setter
hashCode → int
The hash code for this object.
no setterinherited
host → String
Full url to the Serverpod server. E.g. "https://example.com/"
finalinherited
jwtRefresh ↔ EndpointJwtRefresh
latefinal
moduleLookup → Map<String, ModuleEndpointCaller>
Looks up module callers by their name. Overridden by generated code.
no setter
modules ↔ Modules
latefinal
onFailedCall → void Function(MethodCallContext callContext, Object error, StackTrace stackTrace)?
Callback when any call to the server fails or an exception is thrown.
finalinherited
onSucceededCall → void Function(MethodCallContext callContext)?
Callback when any call to the server succeeds.
finalinherited
project ↔ EndpointProject
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sdk ↔ EndpointSdk
latefinal
serializationManager → SerializationManager
The SerializationManager used to serialize objects sent to the server.
finalinherited
streamingConnectionTimeout → Duration
Timeout when opening a web socket connection for a streaming method call. If the connection has not been established within the timeout duration the socket will be closed.
finalinherited

Methods

callServerEndpoint<T>(String endpoint, String method, Map<String, dynamic> args, {bool authenticated = true}) → Future<T>
Calls a server endpoint method by its name, passing arguments in a map. Typically, this method is called by generated code.
inherited
callStreamingServerEndpoint<T, G>(String endpoint, String method, Map<String, dynamic> args, Map<String, Stream> streams, {bool authenticated = true}) → dynamic
Calls a server endpoint method that supports streaming. The streams parameter is a map of stream names to stream objects. The method will listen to the streams and send the data to the server. Typically, this method is called by generated code.
inherited
close() → void
Closes all open connections to the server.
inherited
closeStreamingMethodConnections({Object? exception = const WebSocketClosedException()}) → Future<void>
Closes all open streaming method connections.
inherited
getEndpointOfType<T extends EndpointRef>([String? name]) → T
Returns an endpoint of type T. If more than one endpoint of type T exists, name can be used to disambiguate.
inherited
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