From afbc140288b2c4e36b59e9404803b89bacccfc93 Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Fri, 28 Oct 2022 09:24:04 +0200 Subject: [PATCH 1/4] docs(share_plus): #1299 document XFile.fromData Document the use of temporary directories and why developers should care about it. --- packages/share_plus/share_plus/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/share_plus/share_plus/README.md b/packages/share_plus/share_plus/README.md index 6c25bfe642..0a2fce7b52 100644 --- a/packages/share_plus/share_plus/README.md +++ b/packages/share_plus/share_plus/README.md @@ -71,6 +71,16 @@ Check out our documentation website to learn more. [Plus plugins documentation]( ## Known Issues +### Sharing data created with XFile.fromData + +When sharing data created with `XFile.fromData`, the plugin will write a temporal file inside the cache directory of the app, so it can be shared. + +Althouth the OS should take care of deleting those files, it is adviced, that you clean up this data once in a while (e.g. on app start). + +You can access this directory using `path_provider` 9getTemporaryDirectory](https://pub.dev/documentation/path_provider/latest/path_provider/getTemporaryDirectory.html) + +Alternatively, don't use `XFile.fromData` and instead write the data down to a `File` with a path before sharing it. + ### Mobile platforms (Android and iOS) #### Facebook limitations (WhatsApp, Instagram, Facebook Messenger) From 708410e389539cf6970ced95a8f2b345a38e6eac Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Fri, 28 Oct 2022 09:29:19 +0200 Subject: [PATCH 2/4] Update README.md --- packages/share_plus/share_plus/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/share_plus/share_plus/README.md b/packages/share_plus/share_plus/README.md index 0a2fce7b52..2e0bbad72d 100644 --- a/packages/share_plus/share_plus/README.md +++ b/packages/share_plus/share_plus/README.md @@ -77,9 +77,9 @@ When sharing data created with `XFile.fromData`, the plugin will write a tempora Althouth the OS should take care of deleting those files, it is adviced, that you clean up this data once in a while (e.g. on app start). -You can access this directory using `path_provider` 9getTemporaryDirectory](https://pub.dev/documentation/path_provider/latest/path_provider/getTemporaryDirectory.html) +You can access this directory using [path_provider](https://pub.dev/packages/path_provider) [getTemporaryDirectory](https://pub.dev/documentation/path_provider/latest/path_provider/getTemporaryDirectory.html) -Alternatively, don't use `XFile.fromData` and instead write the data down to a `File` with a path before sharing it. +Alternatively, don't use `XFile.fromData` and instead write the data down to a `File` with a path before sharing it, so you control when to delete it. ### Mobile platforms (Android and iOS) From ee14493e4336e6bf2d2309ea4d82da05df65645e Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Fri, 28 Oct 2022 09:52:37 +0200 Subject: [PATCH 3/4] Update packages/share_plus/share_plus/README.md Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com> --- packages/share_plus/share_plus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/share_plus/share_plus/README.md b/packages/share_plus/share_plus/README.md index 2e0bbad72d..48350101fe 100644 --- a/packages/share_plus/share_plus/README.md +++ b/packages/share_plus/share_plus/README.md @@ -75,7 +75,7 @@ Check out our documentation website to learn more. [Plus plugins documentation]( When sharing data created with `XFile.fromData`, the plugin will write a temporal file inside the cache directory of the app, so it can be shared. -Althouth the OS should take care of deleting those files, it is adviced, that you clean up this data once in a while (e.g. on app start). +Althouth the OS should take care of deleting those files, it is advised, that you clean up this data once in a while (e.g. on app start). You can access this directory using [path_provider](https://pub.dev/packages/path_provider) [getTemporaryDirectory](https://pub.dev/documentation/path_provider/latest/path_provider/getTemporaryDirectory.html) From 1580730244318d56202acb7f028f47c44568631b Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Fri, 28 Oct 2022 09:52:45 +0200 Subject: [PATCH 4/4] Update packages/share_plus/share_plus/README.md Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com> --- packages/share_plus/share_plus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/share_plus/share_plus/README.md b/packages/share_plus/share_plus/README.md index 48350101fe..013ddc57e6 100644 --- a/packages/share_plus/share_plus/README.md +++ b/packages/share_plus/share_plus/README.md @@ -77,7 +77,7 @@ When sharing data created with `XFile.fromData`, the plugin will write a tempora Althouth the OS should take care of deleting those files, it is advised, that you clean up this data once in a while (e.g. on app start). -You can access this directory using [path_provider](https://pub.dev/packages/path_provider) [getTemporaryDirectory](https://pub.dev/documentation/path_provider/latest/path_provider/getTemporaryDirectory.html) +You can access this directory using [path_provider](https://pub.dev/packages/path_provider) [getTemporaryDirectory](https://pub.dev/documentation/path_provider/latest/path_provider/getTemporaryDirectory.html). Alternatively, don't use `XFile.fromData` and instead write the data down to a `File` with a path before sharing it, so you control when to delete it.