Skip to content

Commit d3064de

Browse files
franciscojma86Egor
authored and
Egor
committed
[path_provider_platform_interface] Rename back to StorageDirectory (flutter#2564)
* Rename StorageDirectory * Update version * Update version to non-breaking * Use 1.0.1
1 parent 7178f4d commit d3064de

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.1
2+
3+
* Rename enum to StorageDirectory for backwards compatibility.
4+
15
## 1.0.0
26

37
* Initial release.

packages/path_provider/path_provider_platform_interface/lib/path_provider_platform_interface.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ abstract class PathProviderPlatform extends PlatformInterface {
8585
/// These paths typically reside on external storage like separate partitions
8686
/// or SD cards. Phones may have multiple storage directories available.
8787
Future<List<String>> getExternalStoragePaths({
88-
/// Optional parameter. See [AndroidStorageDirectory] for more informations on
88+
/// Optional parameter. See [StorageDirectory] for more informations on
8989
/// how this type translates to Android storage directories.
90-
AndroidStorageDirectory type,
90+
StorageDirectory type,
9191
}) {
9292
throw UnimplementedError(
9393
'getExternalStoragePaths() has not been implemented.');

packages/path_provider/path_provider_platform_interface/lib/src/enums.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// Corresponds to constants defined in Androids `android.os.Environment` class.
22
///
33
/// https://developer.android.com/reference/android/os/Environment.html#fields_1
4-
enum AndroidStorageDirectory {
4+
enum StorageDirectory {
55
/// Contains audio files that should be treated as music.
66
///
77
/// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_MUSIC.

packages/path_provider/path_provider_platform_interface/lib/src/method_channel_path_provider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class MethodChannelPathProvider extends PathProviderPlatform {
6666
}
6767

6868
Future<List<String>> getExternalStoragePaths({
69-
AndroidStorageDirectory type,
69+
StorageDirectory type,
7070
}) async {
7171
if (!_platform.isAndroid) {
7272
throw UnsupportedError('Functionality only available on Android');

packages/path_provider/path_provider_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: A common platform interface for the path_provider plugin.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_platform_interface
44
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
55
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
6-
version: 1.0.0
6+
version: 1.0.1
77

88
dependencies:
99
flutter:

packages/path_provider/path_provider_platform_interface/test/method_channel_path_provider_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void main() {
147147
}
148148
});
149149

150-
for (AndroidStorageDirectory type
151-
in AndroidStorageDirectory.values + <AndroidStorageDirectory>[null]) {
150+
for (StorageDirectory type
151+
in StorageDirectory.values + <StorageDirectory>[null]) {
152152
test('getExternalStoragePaths (type: $type) android succeeds', () async {
153153
final List<String> result =
154154
await methodChannelPathProvider.getExternalStoragePaths(type: type);

0 commit comments

Comments
 (0)