Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class _MyAppState extends State<MyApp> {
'identifierForVendor': data.identifierForVendor,
'isPhysicalDevice': data.isPhysicalDevice,
'isiOSAppOnMac': data.isiOSAppOnMac,
'isiOSAppOnVision': data.isiOSAppOnVision,
'freeDiskSize': data.freeDiskSize,
'totalDiskSize': data.totalDiskSize,
'physicalRamSize': data.physicalRamSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ - (void)handleMethodCall:(FlutterMethodCall *)call
if (@available(iOS 14.0, *)) {
isiOSAppOnMac = [NSNumber numberWithBool:[info isiOSAppOnMac]];
}
NSNumber *isiOSAppOnVision = [NSNumber numberWithBool:NO];
if (@available(iOS 26.1, *)) {
isiOSAppOnVision = [NSNumber numberWithBool:[info isiOSAppOnVision]];
}
NSError *error = nil;
NSDictionary *fsAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error];
NSNumber *freeSize = [NSNumber numberWithInt:-1];
Expand Down Expand Up @@ -64,6 +68,7 @@ - (void)handleMethodCall:(FlutterMethodCall *)call
@"totalDiskSize" : totalSize,
@"isPhysicalDevice" : isPhysicalNumber,
@"isiOSAppOnMac" : isiOSAppOnMac,
@"isiOSAppOnVision" : isiOSAppOnVision,
@"physicalRamSize" : physicalRamSize,
@"availableRamSize" : availableRamSize,
@"utsname" : @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class IosDeviceInfo extends BaseDeviceInfo {
required this.physicalRamSize,
required this.availableRamSize,
required this.isiOSAppOnMac,
required this.isiOSAppOnVision,
required this.utsname,
}) : super(data);

Expand Down Expand Up @@ -73,6 +74,10 @@ class IosDeviceInfo extends BaseDeviceInfo {
/// https://developer.apple.com/documentation/foundation/nsprocessinfo/3608556-iosapponmac
final bool isiOSAppOnMac;

/// Indicates whether the process is an iPhone or iPad app running on visionOS.
/// https://developer.apple.com/documentation/foundation/processinfo/isiosapponvision
final bool isiOSAppOnVision;

/// Operating system information derived from `sys/utsname.h`.
final IosUtsname utsname;

Expand All @@ -99,6 +104,7 @@ class IosDeviceInfo extends BaseDeviceInfo {
physicalRamSize: map['physicalRamSize'],
availableRamSize: map['availableRamSize'],
isiOSAppOnMac: map['isiOSAppOnMac'],
isiOSAppOnVision: map['isiOSAppOnVision'],
utsname: IosUtsname._fromMap(
map['utsname']?.cast<String, dynamic>() ?? {},
),
Expand All @@ -119,6 +125,7 @@ class IosDeviceInfo extends BaseDeviceInfo {
String? identifierForVendor,
required bool isPhysicalDevice,
required bool isiOSAppOnMac,
required bool isiOSAppOnVision,
required int physicalRamSize,
required int availableRamSize,
required IosUtsname utsname,
Expand All @@ -135,6 +142,7 @@ class IosDeviceInfo extends BaseDeviceInfo {
'totalDiskSize': totalDiskSize,
'isPhysicalDevice': isPhysicalDevice,
'isiOSAppOnMac': isiOSAppOnMac,
'isiOSAppOnVision': isiOSAppOnVision,
'physicalRamSize': physicalRamSize,
'availableRamSize': availableRamSize,
'utsname': {
Expand All @@ -158,6 +166,7 @@ class IosDeviceInfo extends BaseDeviceInfo {
totalDiskSize: totalDiskSize,
isPhysicalDevice: isPhysicalDevice,
isiOSAppOnMac: isiOSAppOnMac,
isiOSAppOnVision: isiOSAppOnVision,
physicalRamSize: physicalRamSize,
availableRamSize: availableRamSize,
utsname: utsname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void main() {
'systemName': 'systemName',
'isPhysicalDevice': true,
'isiOSAppOnMac': true,
'isiOSAppOnVision': true,
'physicalRamSize': 8192,
'availableRamSize': 4096,
'systemVersion': 'systemVersion',
Expand All @@ -40,6 +41,7 @@ void main() {
expect(iosDeviceInfo.modelName, 'modelName');
expect(iosDeviceInfo.isPhysicalDevice, isTrue);
expect(iosDeviceInfo.isiOSAppOnMac, isTrue);
expect(iosDeviceInfo.isiOSAppOnVision, isTrue);
expect(iosDeviceInfo.physicalRamSize, 8192);
expect(iosDeviceInfo.availableRamSize, 4096);
expect(iosDeviceInfo.systemName, 'systemName');
Expand Down
Loading