Map<String, Object?> toJson() => { 'platform': platform.name, 'id': id, 'name': name, if (osVersion != null) 'osVersion': osVersion, if (physical) 'physical': true, };