diff --git a/packages/device_info_plus/device_info_plus/CHANGELOG.md b/packages/device_info_plus/device_info_plus/CHANGELOG.md
index 7989daf604..e3ad044fd0 100644
--- a/packages/device_info_plus/device_info_plus/CHANGELOG.md
+++ b/packages/device_info_plus/device_info_plus/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 3.1.0
+
+- add System GUID to MacOS
+
## 3.0.1
- Upgrade Android compile SDK version
diff --git a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj
index 01652b8f67..5682a4a95a 100644
--- a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj
@@ -217,17 +217,12 @@
buildActionMask = 2147483647;
files = (
);
- inputPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
- "${PODS_ROOT}/../Flutter/Flutter.framework",
- "${BUILT_PRODUCTS_DIR}/device_info_plus/device_info_plus.framework",
- "${BUILT_PRODUCTS_DIR}/integration_test/integration_test.framework",
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
- outputPaths = (
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/integration_test.framework",
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
diff --git a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 1d526a16ed..919434a625 100644
--- a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
+ location = "self:">
diff --git a/packages/device_info_plus/device_info_plus/example/lib/main.dart b/packages/device_info_plus/device_info_plus/example/lib/main.dart
index 5ef1c5e66d..ead8c320c2 100644
--- a/packages/device_info_plus/device_info_plus/example/lib/main.dart
+++ b/packages/device_info_plus/device_info_plus/example/lib/main.dart
@@ -168,6 +168,7 @@ class _MyAppState extends State {
'activeCPUs': data.activeCPUs,
'memorySize': data.memorySize,
'cpuFrequency': data.cpuFrequency,
+ 'systemGUID': data.systemGUID,
};
}
diff --git a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig
index c2efd0b608..4b81f9b2d2 100644
--- a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig
+++ b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig
@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig
index c2efd0b608..5caa9d1579 100644
--- a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig
+++ b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig
@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj
index 5fb492c8ed..61e9be78cc 100644
--- a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj
+++ b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj
@@ -21,15 +21,12 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 15897DDF3F7CA885FC5E384A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F81A5A451B3AC123462ECD1 /* Pods_Runner.framework */; };
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
- 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; };
- 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
- D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; };
- D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -49,8 +46,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
- D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */,
- 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */,
);
name = "Bundle Framework";
runOnlyForDeploymentPostprocessing = 0;
@@ -60,7 +55,7 @@
/* Begin PBXFileReference section */
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; };
- 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
@@ -69,13 +64,15 @@
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; };
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; };
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; };
- 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; };
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; };
+ 6D07D951D7362AA377411A49 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; };
+ 7F81A5A451B3AC123462ECD1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; };
- D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; };
+ E7388E27867E17BA868D55EA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
+ FF9B52311F2436AA220E8D61 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -83,14 +80,24 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
- 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
+ 15897DDF3F7CA885FC5E384A /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 2E8EB0F9823F3C15A5AB32B8 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ FF9B52311F2436AA220E8D61 /* Pods-Runner.debug.xcconfig */,
+ 6D07D951D7362AA377411A49 /* Pods-Runner.release.xcconfig */,
+ E7388E27867E17BA868D55EA /* Pods-Runner.profile.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "";
+ };
33BA886A226E78AF003329D5 /* Configs */ = {
isa = PBXGroup;
children = (
@@ -109,6 +116,7 @@
33CEB47122A05771004F2AC0 /* Flutter */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
+ 2E8EB0F9823F3C15A5AB32B8 /* Pods */,
);
sourceTree = "";
};
@@ -138,8 +146,6 @@
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
- D73912EF22F37F9E000D13A0 /* App.framework */,
- 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */,
);
path = Flutter;
sourceTree = "";
@@ -160,6 +166,7 @@
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 7F81A5A451B3AC123462ECD1 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "";
@@ -171,11 +178,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
+ 45684215EC399FD257470BC8 /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
+ F7992578AF063240CC187B34 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -260,7 +269,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n";
+ shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
};
33CC111E2044C6BF0003C045 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -282,6 +291,46 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
+ 45684215EC399FD257470BC8 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ F7992578AF063240CC187B34 /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
+ "${BUILT_PRODUCTS_DIR}/device_info_plus_macos/device_info_plus_macos.framework",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputPaths = (
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus_macos.framework",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
diff --git a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata
index 1d526a16ed..21a3cc14c7 100644
--- a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata
+++ b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata
@@ -4,4 +4,7 @@
+
+
diff --git a/packages/device_info_plus/device_info_plus/pubspec.yaml b/packages/device_info_plus/device_info_plus/pubspec.yaml
index 1e7feaebd7..71340a69a5 100644
--- a/packages/device_info_plus/device_info_plus/pubspec.yaml
+++ b/packages/device_info_plus/device_info_plus/pubspec.yaml
@@ -1,7 +1,7 @@
name: device_info_plus
description: Flutter plugin providing detailed information about the device
(make, model, etc.), and Android or iOS version the app is running on.
-version: 3.0.1
+version: 3.1.0
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/
@@ -25,9 +25,9 @@ flutter:
dependencies:
flutter:
sdk: flutter
- device_info_plus_platform_interface: ^2.1.0
+ device_info_plus_platform_interface: ^2.2.0
device_info_plus_linux: ^2.1.0
- device_info_plus_macos: ^2.1.0
+ device_info_plus_macos: ^2.2.0
device_info_plus_web: ^2.1.0
device_info_plus_windows: ^2.1.0
diff --git a/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md b/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md
index 30a7bb4a46..a905a6e9a6 100644
--- a/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md
+++ b/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.2.0
+
+- add System GUID to MacOS
+
## 2.1.0
- add toMap to models
diff --git a/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift b/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift
index 9f2ed7443b..05b5d54a0a 100644
--- a/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift
+++ b/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift
@@ -27,6 +27,7 @@ public class DeviceInfoPlusMacosPlugin: NSObject, FlutterPlugin {
let activeCPUs = Sysctl.activeCPUs
let memorySize = Sysctl.memSize
let cpuFrequency = Sysctl.cpuFreq
+ let guid = SystemUUID.getSystemUUID()
result([
"computerName": computerName,
@@ -37,7 +38,8 @@ public class DeviceInfoPlusMacosPlugin: NSObject, FlutterPlugin {
"osRelease": osRelease,
"activeCPUs": activeCPUs,
"memorySize": memorySize,
- "cpuFrequency": cpuFrequency
+ "cpuFrequency": cpuFrequency,
+ "systemGUID": guid
])
}
}
diff --git a/packages/device_info_plus/device_info_plus_macos/macos/Classes/SystemUUID.swift b/packages/device_info_plus/device_info_plus_macos/macos/Classes/SystemUUID.swift
new file mode 100644
index 0000000000..cc9e9ae2b1
--- /dev/null
+++ b/packages/device_info_plus/device_info_plus_macos/macos/Classes/SystemUUID.swift
@@ -0,0 +1,16 @@
+import Foundation
+
+public struct SystemUUID {
+
+ public static func getSystemUUID() -> String? {
+ let dev = IOServiceMatching("IOPlatformExpertDevice")
+ let platformExpert: io_service_t = IOServiceGetMatchingService(kIOMasterPortDefault, dev)
+ let serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, kIOPlatformUUIDKey as CFString, kCFAllocatorDefault, 0)
+ IOObjectRelease(platformExpert)
+ let ser: CFTypeRef? = serialNumberAsCFString?.takeUnretainedValue()
+ if let result = ser as? String {
+ return result
+ }
+ return nil
+ }
+}
\ No newline at end of file
diff --git a/packages/device_info_plus/device_info_plus_macos/pubspec.yaml b/packages/device_info_plus/device_info_plus_macos/pubspec.yaml
index 250d141886..738f5bb602 100644
--- a/packages/device_info_plus/device_info_plus_macos/pubspec.yaml
+++ b/packages/device_info_plus/device_info_plus_macos/pubspec.yaml
@@ -2,14 +2,14 @@ name: device_info_plus_macos
description: Macos implementation of the device_info_plus plugin
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/
-version: 2.1.0
+version: 2.2.0
environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"
dependencies:
- device_info_plus_platform_interface: ^2.1.0
+ device_info_plus_platform_interface: ^2.2.0
flutter:
sdk: flutter
diff --git a/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md b/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md
index 714d84eb4d..ec6b9a79c1 100644
--- a/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md
+++ b/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.2.0
+
+- add System GUID to MacOS
+
## 2.1.0
- add toMap to models
diff --git a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart
index 611e32f76a..e5e2e37322 100644
--- a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart
+++ b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart
@@ -15,6 +15,7 @@ class MacOsDeviceInfo {
required this.activeCPUs,
required this.memorySize,
required this.cpuFrequency,
+ required this.systemGUID,
});
/// Name given to the local machine.
@@ -48,6 +49,9 @@ class MacOsDeviceInfo {
/// Device CPU Frequency
final int cpuFrequency;
+ /// Device GUID
+ final String? systemGUID;
+
/// Serializes [ MacOsDeviceInfo ] to map.
Map toMap() {
return {
@@ -60,6 +64,7 @@ class MacOsDeviceInfo {
'cpuFrequency': cpuFrequency,
'computerName': computerName,
'kernelVersion': kernelVersion,
+ 'systemGUID': systemGUID,
};
}
@@ -75,6 +80,7 @@ class MacOsDeviceInfo {
activeCPUs: map['activeCPUs'],
memorySize: map['memorySize'],
cpuFrequency: map['cpuFrequency'],
+ systemGUID: map['systemGUID'],
);
}
}
diff --git a/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml b/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml
index d8a76a1799..6b73b063ca 100644
--- a/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml
+++ b/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml
@@ -1,6 +1,6 @@
name: device_info_plus_platform_interface
description: A common platform interface for the device_info_plis plugin.
-version: 2.1.0
+version: 2.2.0
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/
diff --git a/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart b/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart
index 06193fa513..2ce927d409 100644
--- a/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart
+++ b/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart
@@ -14,6 +14,7 @@ void main() {
'osRelease': 'osRelease',
'computerName': 'computerName',
'kernelVersion': 'kernelVersion',
+ 'systemGUID': null,
};
test('fromMap should return $MacOsDeviceInfo with correct values', () {
@@ -26,6 +27,41 @@ void main() {
expect(macosDeviceInfo.cpuFrequency, 2);
expect(macosDeviceInfo.hostName, 'hostName');
expect(macosDeviceInfo.osRelease, 'osRelease');
+ expect(macosDeviceInfo.systemGUID, isNull);
+ });
+
+ test('toMap should return map with correct key and map', () {
+ final macosDeviceInfo = MacOsDeviceInfo.fromMap(macosDeviceInfoMap);
+
+ expect(macosDeviceInfo.toMap(), macosDeviceInfoMap);
+ });
+ });
+
+ group('fromMap | toMap', () {
+ const macosDeviceInfoMap = {
+ 'arch': 'arch',
+ 'model': 'model',
+ 'activeCPUs': 4,
+ 'memorySize': 16,
+ 'cpuFrequency': 2,
+ 'hostName': 'hostName',
+ 'osRelease': 'osRelease',
+ 'computerName': 'computerName',
+ 'kernelVersion': 'kernelVersion',
+ 'systemGUID': 'systemGUID',
+ };
+
+ test('fromMap should return $MacOsDeviceInfo with correct values', () {
+ final macosDeviceInfo = MacOsDeviceInfo.fromMap(macosDeviceInfoMap);
+
+ expect(macosDeviceInfo.arch, 'arch');
+ expect(macosDeviceInfo.model, 'model');
+ expect(macosDeviceInfo.activeCPUs, 4);
+ expect(macosDeviceInfo.memorySize, 16);
+ expect(macosDeviceInfo.cpuFrequency, 2);
+ expect(macosDeviceInfo.hostName, 'hostName');
+ expect(macosDeviceInfo.osRelease, 'osRelease');
+ expect(macosDeviceInfo.systemGUID, 'systemGUID');
});
test('toMap should return map with correct key and map', () {