Skip to content

P2: Add file picker to DevTools #2149

Description

@kenzieschmoll

P1 target is the web - but we would like the picker to work for desktop too since that is where we develop.

This picker is needed for the Code Size page under development. The picker will also be used to load snapshots into DevTools for the pages that currently support it (timeline, performance).

The current need is to pick .json files, but we may need to support more file types in the future (likely .zip).

Activity

  1. kenzieschmoll commented on Jul 1, 2020

    @kenzieschmoll
    MemberAuthor

    In terms of Desktop support - even if we were able to just do Mac, that would be helpful for us.

  2. kenzieschmoll commented on Jul 1, 2020

    @kenzieschmoll
    MemberAuthor
  3. ditman commented on Jul 1, 2020

    @ditman
    Member

    @kenzieschmoll there's currently no support for desktop at all in the plugin (and I've never done any Mac development! :P)

    As a backup, have you considered using https://pub.dev/packages/file_picker ? That one seems to support more platforms, and the only thing that you need to consider when dealing on native vs web is that native returns File objects from dart:io, and the web version returns File objects from dart:html.

    (I'm saying this because I don't know if I'll be able to merge my changes to the plugin fast enough for your project!)

  4. ditman commented on Jul 1, 2020

    @ditman
    Member

    Maybe @stuartmorgan can add desktop support to the current image_picker with https://github.com/google/flutter-desktop-embedding/tree/master/plugins/file_chooser?

    OR MAYBE we can add web to the file_chooser plugin?

  5. stuartmorgan-g commented on Jul 1, 2020

    @stuartmorgan-g
    Contributor

    As a backup, have you considered using https://pub.dev/packages/file_picker ? That one seems to support more platforms

    It doesn't support any of the Fluter desktop embeddings, so would only help you for web.

    Maybe @stuartmorgan can add desktop support to the current image_picker with https://github.com/google/flutter-desktop-embedding/tree/master/plugins/file_chooser?

    I'm confused. The bug is talking about opening json and zip files; what does that have to do with image_picker?

    (Image picker functionality could be approximated on macOS using file_chooser, but there are better ways to pick images. file_chooser is poorly suited to implementing image_picker as is, and it would be much better to add an actual macOS implementation to image_picker.)

    OR MAYBE we can add web to the file_chooser plugin?

    The goal is to eliminate FDE; I am strongly opposed to expanding its scope to web.

    I think the first step here is to back up and have a Flutter-level discussion about how file picking should work:

    1. Should it be part of the framework itself?
    2. If not, should it be a 1P plugin?

    If the answer to both is no, then the question for this issue becomes: which existing 3P plugin should be used for dev tools, and what's involved. (E.g., if you want to use file_picker, should we contribute desktop implementations assuming they would be accepted, or host federated implementations somewhere if not?)

    Once we have answers to those two questions, we can figure out what should happen to the desktop functionality that's currently in FDE's file_chooser prototype.

  6. kenzieschmoll commented on Jul 1, 2020

    @kenzieschmoll
    MemberAuthor

    @stuartmorgan who do we need to loop in to answer 1) and 2)?

  7. stuartmorgan-g commented on Jul 1, 2020

    @stuartmorgan-g
    Contributor

    Probably @Hixie as a starting point.

  8. Hixie commented on Jul 1, 2020

    @Hixie

    I'd probably start with a plugin. It sounds similar to things like links on web, where we're starting with a plugin also. On the long term we'll probably fold some of these in but in the meantime having them in a plugin forces us to think about layering it correctly.

  9. ditman commented on Jul 1, 2020

    @ditman
    Member

    what does that have to do with image_picker?

    @stuartmorgan image_picker is the base plugin I used to select arbitrary files on the web filtered by their extension, then I found out about the FDE plugins and file_chooser, and suddenly it wasn't that clear that image_picker was the best place to put my code :)

    The issue is that DevTools needs picking files both in Web and Desktop, and there's no picker plugin (1p nor 3p) that covers that need.

  10. stuartmorgan-g commented on Jul 1, 2020

    @stuartmorgan-g
    Contributor

    I think the next step is to put together a quick proposal doc for a new 1P plugin and send it around for sign-off (from eco-system leads, web and desktop folks, probably API review for feedback on the Dart side, etc.)

    @ditman Do you want to drive that? I don't know when I would be able to get to it, and I also don't know anything about the web vs. desktop file API considerations so would be a poor choice to design an API proposal. (file_chooser didn't go through any process, so is almost certainly not an ideal design even apart from that, but will hopefully be useful as a reference point.)

    Once there's a plugin framework in place I can move functionality from file_chooser to make desktop implementations.

  11. ditman commented on Jul 1, 2020

    @ditman
    Member

    @stuartmorgan yes, let's write a quick doc with a couple of options about this. I still think that the image_picker is the best starting point (other than the now-outdated name containing 'image' :P), but we'll see! Thanks for your support!

  12. added this to the On Deck milestone on Jul 31, 2020
  13. ditman commented on Aug 13, 2020

    @ditman
    Member

    (/cc @tugorez this is the tracking issue for the file picker in the DevTools app)

  14. changed the title [-]Add file picker to DevTools[/-] [+]P2: Add file picker to DevTools[/+] on Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions