NtpClient constructor

const NtpClient({
  1. String server = 'pool.ntp.org',
  2. int port = 123,
  3. int timeout = 5,
  4. String? apiUrl,
  5. DateTime parseResponse(
    1. Response
    )?,
  6. bool isUtc = false,
})

Creates a new NtpClient instance with optional configuration parameters.

  • server specifies the NTP server hostname or IP address (default: 'pool.ntp.org')
  • port is the UDP port number for NTP communication (default: 123)
  • timeout is the maximum duration in seconds to wait for a server response (default: 5)

Implementation

const NtpClient({
  super.server,
  super.port,
  super.timeout,
  super.apiUrl,
  super.parseResponse,
  super.isUtc,
});