system property
Returns the operating system of this UserAgent.
Implementation
String get system {
  // If [UserAgent] starts with "Mozilla", then it's probably a browser's
  // `User-Agent` header.
  if (val.startsWith('Mozilla')) {
    if (val.contains('Windows NT')) {
      return 'Windows';
    } else if (val.contains('iPad')) {
      return 'iPadOS';
    } else if (val.contains('iPhone')) {
      return 'iOS';
    } else if (val.contains('Macintosh')) {
      return 'macOS';
    } else if (val.contains('Android')) {
      return 'Android';
    } else if (val.contains('X11') || val.contains('Linux')) {
      return 'Linux';
    } else {
      return 'Unknown';
    }
  }
  // Otherwise it's probably a one generated via [WebUtils.userAgent] method.
  else {
    final String meta = val.substring(
      max(val.indexOf('(') + 1, 0),
      val.endsWith(')') ? val.length - 1 : val.length,
    );
    // First part should have the name of operating system.
    final List<String> parts = meta.split(';');
    final String system = parts.first.trim();
    if (system.startsWith('Android')) {
      return 'Android';
    } else if (system.startsWith('macOS')) {
      return 'macOS';
    } else if (system.startsWith('iOS')) {
      return 'iOS';
    } else if (system.startsWith('iPadOS')) {
      return 'iPadOS';
    } else if (system.startsWith('visionOS')) {
      return 'visionOS';
    } else if (system.startsWith('watchOS')) {
      return 'watchOS';
    } else if (system.startsWith('tvOS')) {
      return 'tvOS';
    } else if (system.startsWith('Windows')) {
      return 'Windows';
    } else {
      return system;
    }
  }
}