-
-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(share_plus)!: Introduce optional parameter nameOverride
to shareXFiles
.
#3077
Conversation
…reXFiles`. This enables file names to be set for XFiles created from data. See issue [fluttercommunity#3032](fluttercommunity#3032)
Thanks @frieder-audriga I'd have much preferred that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some comments, still haven't tested but the idea seems right to me!
I'd also like to add a bit of documentation in the README, e.g. "how to share files as data" showing the use of this parameter.
packages/share_plus/share_plus_platform_interface/lib/method_channel/method_channel_share.dart
Outdated
Show resolved
Hide resolved
packages/share_plus/share_plus_platform_interface/lib/method_channel/method_channel_share.dart
Outdated
Show resolved
Hide resolved
packages/share_plus/share_plus_platform_interface/lib/method_channel/method_channel_share.dart
Outdated
Show resolved
Hide resolved
packages/share_plus/share_plus_platform_interface/lib/method_channel/method_channel_share.dart
Outdated
Show resolved
Hide resolved
Applied suggestions from code review Co-authored-by: Miguel Beltran <[email protected]>
Thank you for the comments and suggestions. I added a short subsection to the README and addressed the other comments. |
@@ -61,12 +61,14 @@ class SharePlatform extends PlatformInterface { | |||
String? subject, | |||
String? text, | |||
Rect? sharePositionOrigin, | |||
List<String>? fileNameOverrides, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we are changing the platform interface, this requires a major version, otherwise this will cause issues with clients where the platform interface and the main package are not in sync.
nameOverride
to shareXFiles
.nameOverride
to shareXFiles
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Android. LGTM! I did some changes and pushed them to @frieder-audriga fork.
This feature has to be marked as a breaking change since it modifies the platform interface API. fyi @vbuberen
I'll wait a bit and then it can be merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but have a few suggestions to improve comments.
packages/share_plus/share_plus_platform_interface/lib/method_channel/method_channel_share.dart
Outdated
Show resolved
Hide resolved
packages/share_plus/share_plus_platform_interface/lib/method_channel/method_channel_share.dart
Outdated
Show resolved
Hide resolved
Co-authored-by: Volodymyr Buberenko <[email protected]>
Co-authored-by: Volodymyr Buberenko <[email protected]>
Co-authored-by: Volodymyr Buberenko <[email protected]>
Co-authored-by: Volodymyr Buberenko <[email protected]>
…hannel/method_channel_share.dart Co-authored-by: Volodymyr Buberenko <[email protected]>
…hannel/method_channel_share.dart Co-authored-by: Volodymyr Buberenko <[email protected]>
Merging! |
Description
nameOverride
to funcitonshareXFiles
nameOverride
will be used as the file names for the files shareXFile.fromData
ignoresname
parameter on platforms other than web.Related Issues
XFile.name
as the shared file name #1548Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files.flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
!
in the title as explained in Conventional Commits).