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

Commit

Permalink
Update path-provider plug-in
Browse files Browse the repository at this point in the history
Address documentation issues, and update to a more appropriate
exception related to the external storage directory functionality.
  • Loading branch information
natelust committed May 15, 2017
1 parent 397cc63 commit 33b2a6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/path-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [0.2.1] - 2017-05-11

* Add function to determine external storage directory
* Add function to determine external storage directory.

## [0.2.0] - 2017-05-10

Expand Down
6 changes: 3 additions & 3 deletions packages/path-provider/lib/path_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const _channel = const MethodChannel('plugins.flutter.io/path_provider');
/// The current operating system should be determined before issuing this
/// function call, as this functionality is only available on Android.
///
/// On iOS, this function throws an UnimplementedError as it is not possible
/// On iOS, this function throws an UnsupportedError as it is not possible
/// to access outside the app's sandbox.
///
/// On Android this returns getExternalStorageDirectory.
Future<Directory> getExternalStorageDirectory() async {
if (Platform.operatingSystem == "ios")
throw new UnimplementedError("Functionality not available on iOS");
if (Platform.isIOS)
throw new UnsupportedError("Functionality not available on iOS");
final String path = await _channel.invokeMethod('getStorageDirectory');
if (path == null)
return null;
Expand Down

0 comments on commit 33b2a6c

Please sign in to comment.