From 3418972778b1e77c7f3a6dddf0e37c7e37b6ee74 Mon Sep 17 00:00:00 2001 From: Tim Whiting Date: Thu, 4 Jun 2020 12:26:19 -0600 Subject: [PATCH 1/4] updated documentation reflecting changes needed for testing federated plugins --- .../path_provider/path_provider/CHANGELOG.md | 3 +++ packages/path_provider/path_provider/README.md | 18 +++++++++++++++++- .../path_provider/path_provider/pubspec.yaml | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index a2df04613965..226d9ae01d0c 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.6.11 +* Updated documentation to reflect the need for changes in testing for federated plugins + ## 1.6.10 * Linux implementation endorsement diff --git a/packages/path_provider/path_provider/README.md b/packages/path_provider/path_provider/README.md index 944137f4631c..f9c7005c133c 100644 --- a/packages/path_provider/path_provider/README.md +++ b/packages/path_provider/path_provider/README.md @@ -2,7 +2,8 @@ [![pub package](https://img.shields.io/pub/v/path_provider.svg)](https://pub.dartlang.org/packages/path_provider) -A Flutter plugin for finding commonly used locations on the filesystem. Supports iOS and Android. +A Flutter plugin for finding commonly used locations on the filesystem. Supports iOS, Android, Linux and MacOS. +Not all methods are supported on all platforms. ## Usage @@ -19,3 +20,18 @@ String appDocPath = appDocDir.path; ``` Please see the example app of this plugin for a full example. + +### Usage in tests + +Recently `path_provider` was updated to be a federated plugin. + +With that change, tests should be updated to mock `PathProviderPlatform` rather than `PlatformChannel`. + +See this `path_provider` [test](https://github.com/flutter/plugins/blob/master/packages/path_provider/path_provider/test/path_provider_test.dart) for an example. + +You will also have to temporarily add the following line to the setup of your test. +```dart +disablePathProviderPlatformOverride = true; +``` + +See this [issue](https://github.com/flutter/flutter/issues/52267), and these comments [1](https://github.com/flutter/plugins/pull/2789#issuecomment-632354400), [2](https://github.com/flutter/plugins/pull/2789#discussion_r430634873) for details on why this is needed. \ No newline at end of file diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 98059e148140..d83911ddc2a8 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.10 +version: 1.6.11 flutter: plugin: From 5f9cb9518f0ebd23b477a4d58ae87b6955c649ad Mon Sep 17 00:00:00 2001 From: Tim Whiting Date: Thu, 4 Jun 2020 12:30:04 -0600 Subject: [PATCH 2/4] switched version constraint --- packages/path_provider/path_provider/CHANGELOG.md | 2 +- packages/path_provider/path_provider/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 226d9ae01d0c..6d065e1c8bd3 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.6.11 +## 1.6.10+1 * Updated documentation to reflect the need for changes in testing for federated plugins ## 1.6.10 diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index d83911ddc2a8..a91a7f6d8b55 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.11 +version: 1.6.10+1 flutter: plugin: From fd73a1a2f055d3b975bde40100c7e080dede7502 Mon Sep 17 00:00:00 2001 From: Tim Whiting Date: Thu, 4 Jun 2020 12:51:42 -0600 Subject: [PATCH 3/4] fix version num --- packages/path_provider/path_provider/CHANGELOG.md | 2 +- packages/path_provider/path_provider/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 6d065e1c8bd3..226d9ae01d0c 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.6.10+1 +## 1.6.11 * Updated documentation to reflect the need for changes in testing for federated plugins ## 1.6.10 diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index a91a7f6d8b55..d83911ddc2a8 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.10+1 +version: 1.6.11 flutter: plugin: From 8ee06df0b48bc392fb483006e2012eed25290c81 Mon Sep 17 00:00:00 2001 From: Tim Whiting Date: Thu, 4 Jun 2020 15:39:45 -0600 Subject: [PATCH 4/4] update readme --- packages/path_provider/path_provider/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/path_provider/path_provider/README.md b/packages/path_provider/path_provider/README.md index f9c7005c133c..982a9f49cae5 100644 --- a/packages/path_provider/path_provider/README.md +++ b/packages/path_provider/path_provider/README.md @@ -23,9 +23,8 @@ Please see the example app of this plugin for a full example. ### Usage in tests -Recently `path_provider` was updated to be a federated plugin. - -With that change, tests should be updated to mock `PathProviderPlatform` rather than `PlatformChannel`. +`path_provider` now uses a `PlatformInterface`, meaning that not all platforms share the a single `PlatformChannel`-based implementation. +With that change, tests should be updated to mock `PathProviderPlatform` rather than `PlatformChannel`. See this `path_provider` [test](https://github.com/flutter/plugins/blob/master/packages/path_provider/path_provider/test/path_provider_test.dart) for an example. @@ -34,4 +33,4 @@ You will also have to temporarily add the following line to the setup of your te disablePathProviderPlatformOverride = true; ``` -See this [issue](https://github.com/flutter/flutter/issues/52267), and these comments [1](https://github.com/flutter/plugins/pull/2789#issuecomment-632354400), [2](https://github.com/flutter/plugins/pull/2789#discussion_r430634873) for details on why this is needed. \ No newline at end of file +See this [issue](https://github.com/flutter/flutter/issues/52267), for more details on why this is needed. \ No newline at end of file