diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md index a7cfe1dbb283..b7bc07e82bc7 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 ed96698c9589..b7aeb7a6d5f6 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 000000000000..d19103602cdc --- /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 fedb53735fb1..11a946542f26 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 @@ class PathProviderWindows extends PathProviderPlatform { /// 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 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 38f6316abef8..a04366cf0962 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: