Skip to content

Commit acabfe6

Browse files
author
Tim Sneath
authored
Bump ffi dependencies (flutter#3540)
* Update to FFI 1.0 * Bump CHANGELOG
1 parent 31a631c commit acabfe6

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

packages/path_provider/path_provider_windows/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.1.0-nullsafety.3
2+
3+
* Bump ffi dependency to 1.0.0
4+
* Bump win32 dependency to 2.0.0-nullsafety.12
5+
16
## 0.1.0-nullsafety.2
27

38
* Bump ffi dependency to 0.3.0-nullsafety.1

packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class VersionInfoQuerier {
3434
if (VerQueryValue(versionInfo, keyPath, valueAddress, length) == 0) {
3535
return null;
3636
}
37-
return valueAddress.value.unpackString(length.value);
37+
return valueAddress.value.toDartString();
3838
} finally {
3939
calloc.free(keyPath);
4040
calloc.free(length);
@@ -64,7 +64,7 @@ class PathProviderWindows extends PathProviderPlatform {
6464
final error = GetLastError();
6565
throw WindowsException(error);
6666
} else {
67-
path = buffer.unpackString(length);
67+
path = buffer.toDartString();
6868

6969
// GetTempPath adds a trailing backslash, but SHGetKnownFolderPath does
7070
// not. Strip off trailing backslash for consistency with other methods
@@ -132,7 +132,7 @@ class PathProviderWindows extends PathProviderPlatform {
132132
}
133133
}
134134

135-
final path = pathPtrPtr.value.unpackString(MAX_PATH);
135+
final path = pathPtrPtr.value.toDartString();
136136
return Future.value(path);
137137
} finally {
138138
calloc.free(pathPtrPtr);
@@ -183,8 +183,8 @@ class PathProviderWindows extends PathProviderPlatform {
183183

184184
// If there was no product name, use the executable name.
185185
if (productName == null) {
186-
productName = path.basenameWithoutExtension(
187-
moduleNameBuffer.unpackString(moduleNameLength));
186+
productName =
187+
path.basenameWithoutExtension(moduleNameBuffer.toDartString());
188188
}
189189

190190
return companyName != null

packages/path_provider/path_provider_windows/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: path_provider_windows
22
description: Windows implementation of the path_provider plugin
33
homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows
4-
version: 0.1.0-nullsafety.2
4+
version: 0.1.0-nullsafety.3
55

66
flutter:
77
plugin:
@@ -16,8 +16,8 @@ dependencies:
1616
path: ^1.8.0-nullsafety.3
1717
flutter:
1818
sdk: flutter
19-
ffi: '>=0.3.0-nullsafety.1 <2.0.0'
20-
win32: ^2.0.0-nullsafety.10
19+
ffi: ^1.0.0
20+
win32: ^2.0.0-nullsafety.12
2121

2222
dev_dependencies:
2323
flutter_test:

0 commit comments

Comments
 (0)