toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    if (name != null) 'name': name,
    if (resolution != null) 'resolution': resolution,
    if (manufacturer != null) 'manufacturer': manufacturer,
    if (model != null) 'model': model,
    if (modelId != null) 'model_id': modelId,
    if (memorySize != null) 'memory_size': memorySize,
    if (bootTime != null) 'boot_time': bootTime!.millisecondsSinceEpoch,
    if (formFactor != null) 'form_factor': formFactor,
    if (orientation != null) 'orientation': orientation,
    if (rooted != null) 'rooted': rooted,
    if (osName != null) 'os_name': osName,
    if (osVersion != null) 'os_version': osVersion,
    if (emulated != null) 'emulated': emulated,
    if (architecture != null) 'architecture': architecture,
    if (freeMemory != null) 'free_memory': freeMemory,
    if (internalStorageFreeSize != null)
      'internal_storage_free_size': internalStorageFreeSize,
    if (externalStorageFreeSize != null)
      'external_storage_free_size': externalStorageFreeSize,
    if (batteryLevel != null) 'battery_level': batteryLevel,
    if (carrier != null) 'carrier': carrier,
    if (networkType != null) 'network_type': networkType,
    if (ip != null) 'ip': ip,
    if (proxy != null) 'proxy': proxy,
    if (vpn != null) 'vpn': vpn,
  };
}