From 0b06f27dc065c5e43ea1ae6e9baaf898e64d88b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D0=BA=D0=BE=D0=B2=20=D0=A1=D0=B5=D1=80?= =?UTF-8?q?=D0=B3=D0=B5=D0=B9=20=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Mon, 27 Nov 2023 10:38:30 +0300 Subject: [PATCH] [path_provider] add getApplicationCacheDirectory method implementation --- example/lib/packages/path_provider/model.dart | 6 ++++++ example/lib/packages/path_provider/page.dart | 5 +++++ packages/path_provider/path_provider_aurora/README.md | 1 + 3 files changed, 12 insertions(+) diff --git a/example/lib/packages/path_provider/model.dart b/example/lib/packages/path_provider/model.dart index 577b841..ab80c46 100644 --- a/example/lib/packages/path_provider/model.dart +++ b/example/lib/packages/path_provider/model.dart @@ -43,6 +43,12 @@ class PathProviderModel extends Model { return null; } + +/// Directory location where user-specific non-essential (cached) data should be written. + Future getApplicationCacheDirectory() async { + return getApplicationCacheDirectory(); + } + /// Directory containing user document files. Future getApplicationDocumentsDirectory() async { try { diff --git a/example/lib/packages/path_provider/page.dart b/example/lib/packages/path_provider/page.dart index 27f0411..c694c33 100644 --- a/example/lib/packages/path_provider/page.dart +++ b/example/lib/packages/path_provider/page.dart @@ -54,6 +54,11 @@ class _PathProviderPageState extends AppState { desc: l10n.pathProviderDescTemporary, future: model.getTemporaryDirectory(), ), + BlockItem( + title: l10n.pathProviderTitleTemporary, + desc: l10n.pathProviderDescTemporary, + future: model.getApplicationCacheDirectory(), + ), BlockItem( title: l10n.pathProviderTitleApplicationDocuments, desc: l10n.pathProviderDescApplicationDocuments, diff --git a/packages/path_provider/path_provider_aurora/README.md b/packages/path_provider/path_provider_aurora/README.md index 67a219e..dacaf01 100644 --- a/packages/path_provider/path_provider_aurora/README.md +++ b/packages/path_provider/path_provider_aurora/README.md @@ -35,6 +35,7 @@ final Directory? downloadsDir = await getDownloadsDirectory(); ## Supported APIs - [x] `getTemporaryDirectory` - Directory location where user-specific non-essential (cached) data should be written +- [x] `getApplicationCacheDirectory` - alias of getTemporaryDirectory - [x] `getApplicationSupportDirectory` - Directory where the application may place application support files. - [ ] `getLibraryDirectory` - [x] `getApplicationDocumentsDirectory` - Directory containing user document files.