Closed frieder-audriga closed 2 months ago
Note: I am not the only one that is confused by this, see https://github.com/fluttercommunity/plus_plugins/issues/1548#issuecomment-2072047472 and following comments
Thanks for reporting. PR is more than welcome with your suggestion.
Plugin
share_plus
Use case
When sharing a file that is created from data, like so
expected behavior would be that a file called "myFile.txt" would be shared. Instead "{randomUUID}.txt" gets shared.
This is caused by
cross_file
ignoring thename
parameter, when creating an xFile via the fromData constructor see cross_file/lib/src/types/io.dart:43This then causes
share_plus
to assign a name based on a random UUIDv6 and the mimetype.Proposal
Ideally a convenient way (for example an optional parameter) would be introduced that allows us to set/ override the filename of a given file to share.
But if that is not wanted for some reason at least please add to the documentation that
XFile.fromData
ignores the the filename