[path_provider_windows] Add missing method to fake (#3068)
The fake didn't have getFolder, so if a test of something using
path_provider_windows (such as shared_preferences_windows) had a fake
that overrode getFolder, the analyzer would complain about overriding a
non-existent method. This adds it to avoid that analyzer warning.
It also fixes a minor issue introduced in the previous change, where
folder.dart was accidentally made internal rather than public.
diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md
index a7cfe1d..b7bc07e 100644
--- a/packages/path_provider/path_provider_windows/CHANGELOG.md
+++ b/packages/path_provider/path_provider_windows/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 0.0.4+1
+
+* Add getPath to the stub, so that the analyzer won't complain about
+ fakes that override it.
+* export 'folders.dart' rather than importing it, since it's intended to be
+ public.
+
## 0.0.4
* Move the actual implementation behind a conditional import, exporting
diff --git a/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart
index ed96698..b7aeb7a 100644
--- a/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart
+++ b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart
@@ -5,5 +5,6 @@
// path_provider_windows is implemented using FFI; export a stub for platforms
// that don't support FFI (e.g., web) to avoid having transitive dependencies
// break web compilation.
+export 'src/folders_stub.dart' if (dart.library.ffi) 'src/folders.dart';
export 'src/path_provider_windows_stub.dart'
if (dart.library.ffi) 'src/path_provider_windows_real.dart';
diff --git a/packages/path_provider/path_provider_windows/lib/src/folders_stub.dart b/packages/path_provider/path_provider_windows/lib/src/folders_stub.dart
new file mode 100644
index 0000000..d191036
--- /dev/null
+++ b/packages/path_provider/path_provider_windows/lib/src/folders_stub.dart
@@ -0,0 +1,6 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/// Stub version of the actual class.
+class WindowsKnownFolder {}
diff --git a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart
index fedb537..11a9465 100644
--- a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart
+++ b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart
@@ -20,6 +20,10 @@
/// Stub; see comment on VersionInfoQuerier.
VersionInfoQuerier versionInfoQuerier;
+
+ /// Match PathProviderWindows so that the analyzer won't report invalid
+ /// overrides if tests provide fake PathProviderWindows implementations.
+ Future<String> getPath(String folderID) async => '';
}
/// Stub to satisfy the analyzer, which doesn't seem to handle conditional
diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml
index 38f6316..a04366c 100644
--- a/packages/path_provider/path_provider_windows/pubspec.yaml
+++ b/packages/path_provider/path_provider_windows/pubspec.yaml
@@ -1,7 +1,7 @@
name: path_provider_windows
description: Windows implementation of the path_provider plugin
homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows
-version: 0.0.4
+version: 0.0.4+1
flutter:
plugin: