FTPConnect constructor

FTPConnect(
  1. String host, {
  2. int? port,
  3. String user = 'anonymous',
  4. String pass = '',
  5. bool showLog = false,
  6. SecurityType securityType = SecurityType.FTP,
  7. Logger? logger,
  8. int timeout = 30,
})

Create a FTP Client instance

host: Hostname or IP Address port: Port number (Defaults to 21 for FTP and FTPES, 990 for FTPS) user: Username (Defaults to anonymous) pass: Password if not anonymous login debug: Enable Debug Logging timeout: Timeout in seconds to wait for responses

Implementation

FTPConnect(
  String host, {
  int? port,
  String user = 'anonymous',
  String pass = '',
  bool showLog = false,
  SecurityType securityType = SecurityType.FTP,
  Logger? logger,
  int timeout = 30,
})  : _user = user,
      _pass = pass {
  port ??= securityType == SecurityType.FTPS ? 990 : 21;
  _socket = FTPSocket(
    host,
    port,
    securityType,
    logger != null ? logger : Logger(isEnabled: showLog),
    timeout,
  );
}