remote function Null safety

DatabaseConnection remote(
  1. StreamChannel<Object?> channel,
  2. {bool debugLog = false}
)

Connects to a remote server over a two-way communication channel.

On the remote side, the corresponding channel must have been passed to DriftServer.serve for this setup to work.

The optional debugLog can be enabled to print incoming and outgoing messages.

Implementation

DatabaseConnection remote(StreamChannel<Object?> channel,
    {bool debugLog = false}) {
  final client = DriftClient(channel, debugLog);
  return client.connection;
}