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

[Feature request] Choose flutter app as windows default app #147466

Open
Jamalianpour opened this issue Apr 27, 2024 · 4 comments
Open

[Feature request] Choose flutter app as windows default app #147466

Jamalianpour opened this issue Apr 27, 2024 · 4 comments
Labels
a: desktop Running on desktop c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter platform-windows Building on or for Windows specifically team-desktop Owned by Desktop platforms team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@Jamalianpour
Copy link

Jamalianpour commented Apr 27, 2024

Use case

Currently, Flutter apps built for Windows desktop may not be readily discoverable when users attempt to set default programs for opening specific file types (e.g., images). This can hinder the user experience and limit the adoption of Flutter apps as default tools.

I have a flutter app that can open and edit images, now I want to make it the default windows app.
But it was not shown in the list of programs:

default app

Proposal

  • Flutter can set the application type for different file types, so the end user has a better user experience.
  • Makes Flutter apps more competitive as users can seamlessly integrate them into their workflow.
  • Contributes to a more robust and feature-rich Flutter framework for Windows desktop development.
@Jamalianpour Jamalianpour changed the title Choose flutter app as windows default app [Feature request] Choose flutter app as windows default app Apr 27, 2024
@darshankawar darshankawar added in triage Presently being triaged by the triage team c: new feature Nothing broken; request for a new capability platform-windows Building on or for Windows specifically c: proposal A detailed proposal for a change to Flutter a: desktop Running on desktop team-desktop Owned by Desktop platforms team and removed in triage Presently being triaged by the triage team labels Apr 29, 2024
@stuartmorgan
Copy link
Contributor

stuartmorgan commented Apr 29, 2024

Currently, Flutter apps built for Windows desktop may not be readily discoverable when users attempt to set default programs for opening specific file types (e.g., images).

Could you elaborate on what you mean by this? Are you saying you added the necessary system registry keys for your application to be registered as a handler for a file type, as would be necessary for any application on Windows (Flutter or not), and it still didn't show up as an option?

@loic-sharma
Copy link
Member

loic-sharma commented Apr 29, 2024

Like Stuart said, this should be possible with Flutter. Here are Windows's docs on how to register which file types your application can open: https://learn.microsoft.com/en-us/windows/win32/shell/how-to-register-a-file-type-for-a-new-application

You should be able to use package:win32 to interact with the Windows registry. For example: https://github.com/dart-windows/win32/blob/158d0d67112015b5bc9ddc1a35f72b60c0d584fd/example/registry.dart#L80-L99

Please let us know if there's something in Flutter that blocks you from accomplishing this.

@loic-sharma loic-sharma added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 29, 2024
@Jamalianpour
Copy link
Author

The package:win32 and registry modification approach you provided is definitely valuable for associating our Flutter app with specific file types when users right-click "Open with...". This improves discoverability in that context.

However, my primary concern is making Flutter apps appear in the list of default apps within Windows Settings > Apps > Default apps. This is where users set their preferred programs for handling various file types (like Photo) by default. Currently, Flutter apps seem to be missing from that list.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 29, 2024
@loic-sharma
Copy link
Member

Currently, Flutter apps seem to be missing from that list.

Does Flutter need to do something different to be on that list?

I suspect that Windows uses your app's supported file types to determine whether the app can be a default app for photos. In other words, I suspect this is a problem with your app and not Flutter.

My recommendation would be:

  1. Find a third-party app that shows up on the photos app list
  2. Update your app's registry keys to mirror the third-party app's supported file types.
  3. Check if your app shows up on the list of photos apps

If this doesn't fix your issue, then please:

  1. Create a native app using win32, or WinForms, or WPF, or WinRT
  2. Make your native app show up on the list of photos app. You might need to reach out to Windows communities for help here.
  3. Once your native app shows up on the list of photos apps, please share:
    1. Your sample native app that shows up on the list of photos app
    2. A sample Flutter app that attempts to show up on the list of photos app

@loic-sharma loic-sharma added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter platform-windows Building on or for Windows specifically team-desktop Owned by Desktop platforms team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

4 participants