Skip to content
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

Merged
merged 16 commits into from
Jul 23, 2024

Conversation

frieder-audriga
Copy link
Contributor

@frieder-audriga frieder-audriga commented Jul 5, 2024

Description

  • Adds parameter nameOverride to funciton shareXFiles
  • If set the values in nameOverride will be used as the file names for the files share
  • Also added new button in example that demonstrates this behavior.
  • This is needed because XFile.fromData ignores name parameter on platforms other than web.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (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?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@miquelbeltran miquelbeltran self-requested a review July 5, 2024 15:01
@miquelbeltran miquelbeltran self-assigned this Jul 5, 2024
@miquelbeltran
Copy link
Member

Thanks @frieder-audriga

I'd have much preferred that the cross_file package would actually use the name param, but since that's not the case this is the best second option ;)

Copy link
Member

@miquelbeltran miquelbeltran left a 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.

@frieder-audriga
Copy link
Contributor Author

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,
Copy link
Member

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.

@miquelbeltran miquelbeltran changed the title feat(share_plus): Introduce optional parameter nameOverride to shareXFiles. feat(share_plus)!: Introduce optional parameter nameOverride to shareXFiles. Jul 12, 2024
Copy link
Member

@miquelbeltran miquelbeltran left a 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.

Copy link
Collaborator

@vbuberen vbuberen left a 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.

@miquelbeltran
Copy link
Member

Merging!

@miquelbeltran miquelbeltran merged commit f483bce into fluttercommunity:main Jul 23, 2024
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request]: Improve documentation for filename used in shareXFiles
3 participants