Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Add docs
  • Loading branch information
stuartmorgan-g committed Feb 20, 2021
commit 6a646350b7628f5665b927217d097ebd44b70243
12 changes: 12 additions & 0 deletions packages/path_provider/path_provider/lib/path_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ PathProviderPlatform get _platform {
/// On iOS, this uses the `NSCachesDirectory` API.
///
/// On Android, this uses the `getCacheDir` API on the context.
///
/// Throws a `MissingPlatformDirectoryException` if the system is unable to
/// provide the directory.
Future<Directory> getTemporaryDirectory() async {
final String? path = await _platform.getTemporaryPath();
if (path == null) {
Expand All @@ -91,6 +94,9 @@ Future<Directory> getTemporaryDirectory() async {
/// If this directory does not exist, it is created automatically.
///
/// On Android, this function uses the `getFilesDir` API on the context.
///
/// Throws a `MissingPlatformDirectoryException` if the system is unable to
/// provide the directory.
Future<Directory> getApplicationSupportDirectory() async {
final String? path = await _platform.getApplicationSupportPath();
if (path == null) {
Expand All @@ -106,6 +112,9 @@ Future<Directory> getApplicationSupportDirectory() async {
///
/// On Android, this function throws an [UnsupportedError] as no equivalent
/// path exists.
///
/// Throws a `MissingPlatformDirectoryException` if the system is unable to
/// provide the directory on a supported platform.
Future<Directory> getLibraryDirectory() async {
final String? path = await _platform.getLibraryPath();
if (path == null) {
Expand All @@ -123,6 +132,9 @@ Future<Directory> getLibraryDirectory() async {
/// On Android, this uses the `getDataDirectory` API on the context. Consider
/// using [getExternalStorageDirectory] instead if data is intended to be visible
/// to the user.
///
/// Throws a `MissingPlatformDirectoryException` if the system is unable to
/// provide the directory.
Future<Directory> getApplicationDocumentsDirectory() async {
final String? path = await _platform.getApplicationDocumentsPath();
if (path == null) {
Expand Down