Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[path_provider] Updated documentation reflecting changes needed for testing #2815

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/path_provider/path_provider/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
17 changes: 16 additions & 1 deletion packages/path_provider/path_provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -19,3 +20,17 @@ String appDocPath = appDocDir.path;
```

Please see the example app of this plugin for a full example.

### Usage in tests

`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.

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), for more details on why this is needed.
2 changes: 1 addition & 1 deletion packages/path_provider/path_provider/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down