-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[file_selector] Migrate Windows implementation from CPP to Dart #6568
[file_selector] Migrate Windows implementation from CPP to Dart #6568
Conversation
e346432
to
13fbe29
Compare
13fbe29
to
604d464
Compare
6fb9f00
to
5b1388c
Compare
I've seen that this check legacy-version-analyze CHANNEL:2.10.5 is failing, and as far as I understand, It is related to new dependencies like environment:
sdk: '>=2.17.0 <3.0.0' I'm not sure how to address this situation, But I'm wondering if we should change the environment settings in the package from: environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.10.0" to: environment:
sdk: ">=2.17.0 <3.0.0"
flutter: ">=3.0.0" Will that avoid running the legacy-version-analyze check? |
683d232
to
ef9df57
Compare
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/shell_win32_api.dart
Outdated
Show resolved
Hide resolved
...s/file_selector/file_selector_windows/lib/src/file_selector_dart/file_dialog_controller.dart
Outdated
Show resolved
Hide resolved
f38a4a5
to
73bd832
Compare
Hi @timsneath thanks for your feedback, we applied some changes, can you take a look again? What we did specifically was:
|
a50ef98
to
602c020
Compare
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/dialog_mode.dart
Outdated
Show resolved
Hide resolved
...ges/file_selector/file_selector_windows/lib/src/file_selector_dart/ifile_dialog_factory.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/shell_win32_api.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_api.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_api.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/dialog_wrapper.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/example/lib/open_text_page.dart
Show resolved
Hide resolved
...s/file_selector/file_selector_windows/lib/src/file_selector_dart/file_dialog_controller.dart
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/dialog_wrapper.dart
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/shell_win32_api.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/shell_win32_api.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_api.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/file_selector_windows.dart
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/test/file_selector_api_test.dart
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/dialog_wrapper.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/dialog_wrapper.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/shell_win32_api.dart
Outdated
Show resolved
Hide resolved
packages/file_selector/file_selector_windows/lib/src/file_selector_dart/dialog_wrapper.dart
Show resolved
Hide resolved
Hi @loic-sharma, thanks for your feedback. At a glance, there are some cases when we are returning an empty string or not throwing an exception. The reason for this was to maintain the exact implementation that was written in C++. If you agree, I'll make the changes to throw a Thanks!! |
Gotcha, that makes perfect sense! This Dart migration is already a major change; I agree that minimizing the differences between the two implementations is valuable.
I'm not very familiar with the existing C++ implementation, I'll take a closer look at that and get back to you. |
904da58
to
674daad
Compare
Thanks, @loic-sharma. Regarding my previous comment, I applied this one:
to match the API expectation, regardless of the previous C++ implementation. (Pigeons used to handle this in the top level as I recently double-checked) Moreover, since the I think we are now in better shape. Thanks!! |
022482b
to
25b65a5
Compare
packages/file_selector/file_selector_windows/example/lib/open_text_page.dart
Outdated
Show resolved
Hide resolved
9e06460
to
bc78285
Compare
Co-authored-by: Alejandro Pinola <[email protected]>
bc78285
to
24ae23b
Compare
From triage: what's the status of this PR? Is it waiting for new updates, or for re-review? |
I'll take a look after Flutter Forward if you don't hear from anyone else.
…On Tue, Jan 17, 2023 at 10:16 PM stuartmorgan ***@***.***> wrote:
From triage: what's the status of this PR? Is it waiting for new updates,
or for re-review?
—
Reply to this email directly, view it on GitHub
<#6568 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARWL67KY7LVHAHCSHKTGPLWS3V2HANCNFSM6AAAAAARDQOI6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@stuartmorgan It is ready for re-review. |
Apologies if I missed or forgot some discussion elsewhere, but what are the changes in approach here relative to https://github.com/flutter/plugins/pull/6467to address #6467 (comment)? There were incremental PRs, but those got re-combined, so it seems like we're back to a full from-scratch rewrite here. |
Hi, the main difference is that we kept a 1:1 relation between Dart and Cpp classes. Morevorer, method's were implemented following the same logic as they used to have in old Cpp implementation, like input and returned values. |
We've just completed the migration of the plugin code to the flutter/packages repository, as described in https://flutter.dev/go/flutter-plugins-repo-migration, and this repository is now being archived. Unfortunately that means that all in-progress PRs here must be moved to flutter/packages. Please see our instructions for an explanation of how to move your PR, and if you have any issues moving your PR please don't hesitate to reach out in the #hackers-ecosystem channel in Discord. Our apologies that your PR was caught in this one-time transition. We're aware that it's disruptive in the short term, and appreciate your help in getting us to a better long-term state! |
This PR migrates the Windows CPP implementation to Dart.
These changes have no impact on the API.
We also kept consistency along method signatures and return values across all classes between CPP and Dart versions.
We followed the styling guide from these recommendations, but it is important to note that in order for the
format
check to pass, some of those recommendations can't be followed, like this one.This PR includes the changes in:
which are partial migrations from involved classes. (feedback and last updates were not applied there)
Issue: [file_selector_windows] Migrate CPP implementation to Dart. #112212
The following images show the current functionality tested against the example app located at
file_selector_windows/example
Open File
Open Image
Open Multiple Images
Save a File
Get Directory Path
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.