plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[share_plus] [UPDATE] `shareFiles()` with default apps or specific[limited] desktop app. Windows only

Open theshivamlko opened this issue 2 years ago • 13 comments

Description

Currently Support WINDOWS only, checking for macOS and Linux.

  1. Added ShareWithApp param in shareFiles(), which can open file with its data as input to specific list of apps or default app .
  2. It skips browser requirement to launch an app on desktop.
  3. The supported apps in plugin is NOTEPAD, NOTEPAD++, EDGE, PHOTOSHOP, MSPAINT, CHROME or BY_DEFAULT_APP will make file handle by system defaults app.
  • Select File, it will open by default app handler by Windows or specific app mentioned. It will skip browser need to open desktop app.

Related Issues

Before sharing file was not available for desktop apps in plugin and browser launch was required to launch some basic app.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • [x] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • [x] All existing and new tests are passing.
  • [x] I updated the version in pubspec.yaml and CHANGELOG.md.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] The analyzer (flutter analyze) does not report any problems on my PR.
  • [x] I read and followed the [Flutter Style Guide].
  • [x] I am willing to follow-up on review comments in a timely manner.

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 a breaking change in CHANGELOG.md and increment major revision).
  • [x] No, this is not a breaking change.

theshivamlko avatar Apr 01 '22 19:04 theshivamlko

This looks very interesting indeed!

However, I am not in favor of adding a new method that only works on Windows.

Is there a chance that this could be implemented within the call to Share.shareFiles with an optional named parameter for Windows? (that defaults to "default app").

We have a rule in which we cannot accept features that only support one platform: https://github.com/fluttercommunity/plus_plugins/blob/main/CONTRIBUTING.md#-cannot-be-accepted

So we would encourage to either integrate this functionality in existing library methods (shareFiles) or to create this as an independent package not part of share_plus.

miquelbeltran avatar Apr 06 '22 07:04 miquelbeltran

Hi @miquelbeltran , thanks for suggestion. I will move this to Share.shareFiles with optional parameter of type ShareWithAppWindows for Windows only.

theshivamlko avatar Apr 06 '22 07:04 theshivamlko

Hi @miquelbeltran , code updated feature moved to shareFiles() , with optional param ShareWithApp appName; windows only. I will see for macos and linux support

theshivamlko avatar Apr 06 '22 15:04 theshivamlko

There are formatting errors still, can you check those?

miquelbeltran avatar Apr 07 '22 07:04 miquelbeltran

There are formatting errors still, can you check those?

solved

theshivamlko avatar Apr 07 '22 12:04 theshivamlko

There are some tests failing as well, can you take a look at those? also, see if you can add new ones.

miquelbeltran avatar Apr 07 '22 12:04 miquelbeltran

There are some tests failing as well, can you take a look at those? also, see if you can add new ones.

I tired to resolve multiple failed test for multiple packages in repo, but it results in more tests error. Can you check this?

theshivamlko avatar Apr 08 '22 11:04 theshivamlko

I don't think the PR about share_plus should make changes in other packages. According to logs from Github Actions tests which were failing before @miquelbeltran wrote a comment about it only failed for share_plus. Thus, would ask to fix only tests which were failing for the changed plugin.

vbuberen avatar Apr 10 '22 11:04 vbuberen

The tests in share_plus_platform_interface are failing and should be fixed before merging.

Also, there's formatting issues affecting all packages, but that may be due to an upgrade in the Dart formatter. This can be seen here: https://github.com/fluttercommunity/plus_plugins/runs/5884414642?check_suite_focus=true

I am taking a look at the formatting issue directly on the main branch, yo don't need to fix those.

miquelbeltran avatar Apr 11 '22 07:04 miquelbeltran

The tests in share_plus_platform_interface are failing and should be fixed before merging.

Also, there's formatting issues affecting all packages, but that may be due to an upgrade in the Dart formatter. This can be seen here: https://github.com/fluttercommunity/plus_plugins/runs/5884414642?check_suite_focus=true

I am taking a look at the formatting issue directly on the main branch, yo don't need to fix those.

@miquelbeltran share_plus test resolved. Please check for formatting . Thanks

theshivamlko avatar Apr 11 '22 08:04 theshivamlko

Thanks, currently pending on https://github.com/fluttercommunity/plus_plugins/pull/832

miquelbeltran avatar Apr 11 '22 09:04 miquelbeltran

If you implement the feature for shareFiles please also implement it for shareFilesWithResult :)

Coronon avatar Apr 11 '22 10:04 Coronon

We should also aim for no coverage regression here

Coronon avatar Apr 11 '22 10:04 Coronon

@theshivamlko Do you still plan to update this PR and address all the feedback?

vbuberen avatar Oct 02 '22 16:10 vbuberen

@theshivamlko Do you still plan to update this PR and address all the feedback?

Yes , I will update this week.

theshivamlko avatar Oct 02 '22 17:10 theshivamlko

Hey! Due to changes in our contributor guidelines, all PRs should now:

  • Have a title that follows the Conventional Commits format. e.g. feat(package_name)!: feature description
  • DO NOT modify the CHANGELOG.md or the version in the pubspec.yaml. This is going to be an automated process now.

We would ask you kindly to update the PR following these changes.

Thanks!

miquelbeltran avatar Oct 07 '22 06:10 miquelbeltran

We merged a share implementation for Windows already, so I understand that this PR is no longer necessary.

Thanks for your contribution @theshivamlko anyway, sorry we couldn't get this landed sooner.

miquelbeltran avatar Oct 07 '22 16:10 miquelbeltran