readDeviceIp method

InternetAddress readDeviceIp({
  1. String? description,
  2. String? title,
})

Implementation

InternetAddress readDeviceIp({String? description, String? title}) {
  if (description != null) {
    logger.info(description);
    logger.spaces();
  }

  final String deviceIp = inputWithValidation(
    title ?? 'Device IP-address:',
    validator: (s) {
      if (s.isValidIpAddress) {
        return null;
      }
      return 'Invalid IP-address. Please try again.';
    },
  );

  final ip = InternetAddress(deviceIp);

  logger.spaces();

  return ip;
}