onConnectionEstablished method

  1. @override
FutureOr<void> onConnectionEstablished(
  1. ConnectionInfo connectionInfo,
  2. String serverGreeting
)

Is called after the initial connection has been established

Implementation

@override
FutureOr<void> onConnectionEstablished(
  ConnectionInfo connectionInfo,
  String serverGreeting,
) {
  if (serverGreeting.startsWith('+OK')) {
    final chunks = serverGreeting.split(' ');
    serverInfo = PopServerInfo(chunks.last.trimRight());
  } else {
    serverInfo = PopServerInfo('');
  }
}