@@ -30,10 +30,12 @@ class DeviceInfoPlusWindowsPlugin extends DeviceInfoPlatform {
3030 // package:win32, so we have to manually define it here.
3131 //
3232 // ignore: non_constant_identifier_names
33- void Function (Pointer <OSVERSIONINFOEX >) RtlGetVersion =
34- DynamicLibrary .open ('ntdll.dll' ).lookupFunction<
35- Void Function (Pointer <OSVERSIONINFOEX >),
36- void Function (Pointer <OSVERSIONINFOEX >)> ('RtlGetVersion' );
33+ void Function (Pointer <OSVERSIONINFOEX >) RtlGetVersion = DynamicLibrary .open (
34+ 'ntdll.dll' ,
35+ ).lookupFunction<
36+ Void Function (Pointer <OSVERSIONINFOEX >),
37+ void Function (Pointer <OSVERSIONINFOEX >)
38+ > ('RtlGetVersion' );
3739
3840 /// Returns a [WindowsDeviceInfo] with information about the device.
3941 @override
@@ -44,30 +46,36 @@ class DeviceInfoPlusWindowsPlugin extends DeviceInfoPlatform {
4446 @visibleForTesting
4547 WindowsDeviceInfo getInfo () {
4648 final systemInfo = calloc <SYSTEM_INFO >();
47- final osVersionInfo = calloc <OSVERSIONINFOEX >()
48- ..ref.dwOSVersionInfoSize = sizeOf <OSVERSIONINFOEX >();
49+ final osVersionInfo =
50+ calloc <OSVERSIONINFOEX >()
51+ ..ref.dwOSVersionInfoSize = sizeOf <OSVERSIONINFOEX >();
4952
5053 try {
51- final currentVersionKey = Registry .openPath (RegistryHive .localMachine,
52- path: r'SOFTWARE\Microsoft\Windows NT\CurrentVersion' );
54+ final currentVersionKey = Registry .openPath (
55+ RegistryHive .localMachine,
56+ path: r'SOFTWARE\Microsoft\Windows NT\CurrentVersion' ,
57+ );
5358 final buildLab = currentVersionKey.getStringValue ('BuildLab' ) ?? '' ;
5459 final buildLabEx = currentVersionKey.getStringValue ('BuildLabEx' ) ?? '' ;
5560 final digitalProductId =
5661 currentVersionKey.getBinaryValue ('DigitalProductId' ) ??
57- Uint8List .fromList ([]);
62+ Uint8List .fromList ([]);
5863 final displayVersion =
5964 currentVersionKey.getStringValue ('DisplayVersion' ) ?? '' ;
6065 final editionId = currentVersionKey.getStringValue ('EditionID' ) ?? '' ;
6166 final installDate = DateTime .fromMillisecondsSinceEpoch (
62- 1000 * (currentVersionKey.getIntValue ('InstallDate' ) ?? 0 ));
67+ 1000 * (currentVersionKey.getIntValue ('InstallDate' ) ?? 0 ),
68+ );
6369 final productId = currentVersionKey.getStringValue ('ProductID' ) ?? '' ;
6470 var productName = currentVersionKey.getStringValue ('ProductName' ) ?? '' ;
6571 final registeredOwner =
6672 currentVersionKey.getStringValue ('RegisteredOwner' ) ?? '' ;
6773 final releaseId = currentVersionKey.getStringValue ('ReleaseId' ) ?? '' ;
6874
69- final sqmClientKey = Registry .openPath (RegistryHive .localMachine,
70- path: r'SOFTWARE\Microsoft\SQMClient' );
75+ final sqmClientKey = Registry .openPath (
76+ RegistryHive .localMachine,
77+ path: r'SOFTWARE\Microsoft\SQMClient' ,
78+ );
7179 final machineId = sqmClientKey.getStringValue ('MachineId' ) ?? '' ;
7280
7381 GetSystemInfo (systemInfo);
@@ -140,8 +148,11 @@ class DeviceInfoPlusWindowsPlugin extends DeviceInfoPlatform {
140148 // Now allocate memory for a native string and call this a second time.
141149 final lpBuffer = wsalloc (nSize.value);
142150 try {
143- final result =
144- GetComputerNameEx (ComputerNameDnsFullyQualified , lpBuffer, nSize);
151+ final result = GetComputerNameEx (
152+ ComputerNameDnsFullyQualified ,
153+ lpBuffer,
154+ nSize,
155+ );
145156
146157 if (result != 0 ) {
147158 return lpBuffer.toDartString ();
0 commit comments