google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 607 forks source link

Add desktop implementations of file_selector #815

Closed stuartmorgan closed 3 years ago

stuartmorgan commented 3 years ago

Adds desktop implementations of the file_selector plugin. These will temporarily be hosted here, rather than flutter/plugins, because we don't have a testing strategy for native UI in desktop plugins, so don't meet the testing requirements for flutter/plugins (whereas we already have file_chooser here without tests, so this leaves us no worse off).

While this looks like a lot of new code, there's not actually much that's new:

This initial implementation deliberately uses file_chooser code as much as possible to make for a simple transition to file_selector. Longer term we should consider:

stuartmorgan commented 3 years ago

Unfortunately despite the native plugin code being largely identical to file_chooser, the class renaming was apparently enough delta that git isn't picking it up as a copy+modification.

stuartmorgan commented 3 years ago

(Once this lands I'll publish these plugins, under my account for now; once that's done and file_selector itself is published, I'll remove file_chooser.)

stuartmorgan commented 3 years ago

Since file_selector is published, and the changes here are minor, I'm going to go ahead and land this so I can publish the implementations so that people can start transitioning to file_selector. @cbracken if you want to do a post-landing review, I can address anything in a follow-up; if not, there will be another review point when it's time to move this to flutter/plugins.