[devtools_app] Integrate the file_selector plugin#2506
[devtools_app] Integrate the file_selector plugin#2506kenzieschmoll merged 11 commits intoflutter:masterfrom
Conversation
|
Fixes #2149 |
b9fa43c to
451f60a
Compare
|
@kenzieschmoll I added support for web, linux and macOS. I manually tested web and it works. |
451f60a to
b618a3f
Compare
There was a problem hiding this comment.
can this just be true? what will happen if someone tries to build devtools and run on windows? defaultTargetPlatform == TargetPlatform.macOS is false when I tested on my mac.
There was a problem hiding this comment.
can this just be true? what will happen if someone tries to build devtools and run on windows?
If someone presses the import button in a platform that is not supported by file_selector then an Unimplemented error will be thrown.
defaultTargetPlatform == TargetPlatform.macOS is false when I tested on my mac.
Oh then I should find another way to discover the platform the project is running on.
There was a problem hiding this comment.
Is there some reason you're not using file_selector_windows?
There was a problem hiding this comment.
Is there some reason you're not using file_selector_windows?
That's a good point. Let me add it and remove the platform validation. @kenzieschmoll does that sounds good to you?
There was a problem hiding this comment.
making it work on all platforms sgtm 👍
There was a problem hiding this comment.
end users won't be hit by this anyway - they use DevTools on web. We mostly develop on Mac and Linux and none of us to my knowledge develop on windows.
There was a problem hiding this comment.
I just added windows and removed the platform validation. Thanks to both :)!
@stuartmorgan do you know why this might be happening? I'm providing this XTypeGroup to the plugin. |
You want I'm surprised it worked on web. Maybe there's fixup happening there? Edit: Looks like there is: |
Oh you are right. Prepending a "." to the extensions is a web only thing. It should be fine to change ".json" to "json" as the "normalization" should be handled by this. |
I changed the extension, @kenzieschmoll PTAL :) |
|
cc @ditman |
kenzieschmoll
left a comment
There was a problem hiding this comment.
tested manually on Mac and it works great! I assume linux would work too - maybe @jacob314 or @terrylucas could do a quick check since you already have a linux dev environment set up?
There was a problem hiding this comment.
can you add overflow: TextOverflow.ellipsis, to this text widget? thanks.
There was a problem hiding this comment.
can you make List<String> acceptedTypeGroups an optional parameter in the FileImportContainer constructor that defaults to ['json'], and use that here instead?
packages/devtools_app/pubspec.yaml
Outdated
There was a problem hiding this comment.
any reason for changing from ' to " ? if not, can we leave as single quotes? here, and elsewhere in pubspec.yaml
packages/devtools_app/pubspec.yaml
Outdated
There was a problem hiding this comment.
please revert these white space changes as well. Thank you.
There was a problem hiding this comment.
Echoing kenz's earlier review:
can you make
List<String> acceptedTypeGroupsan optional parameter in theFileImportContainerconstructor that defaults to['json'], and use that here instead?
acceptedTypeGroups should be defined in line ~20 of this file, and be an optional named parameter to FileImportContainer, which defaults to the current XTypeGroup of json, so they can use the FileImportContainer in other places of the App (to select TXT files or PNG or whatever) :)
d0dcc51 to
6f1081f
Compare
packages/devtools_app/lib/src/app_size/file_import_container.dart
Outdated
Show resolved
Hide resolved
kenzieschmoll
left a comment
There was a problem hiding this comment.
One nit - then LGTM. Thanks for your work on this!
|
👏 bravo! |

Fix #2505