-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[file_selector] Add file group to save return value - platform interface #4254
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
Merged
auto-submit
merged 3 commits into
flutter:main
from
stuartmorgan-g:file-selector-save-extension-group-platform-interface
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/file_selector/file_selector_platform_interface/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 2.6.0 | ||
|
|
||
| * Adds `getSaveLocation` and deprecates `getSavePath`. | ||
|
|
||
| ## 2.5.1 | ||
|
|
||
| * Adds compatibility with `http` 1.0. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ges/file_selector/file_selector_platform_interface/lib/src/types/file_dialog_options.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart' show immutable; | ||
|
|
||
| /// Configuration options for any file selector dialog. | ||
| @immutable | ||
| class FileDialogOptions { | ||
| /// Creates a new options set with the given settings. | ||
| const FileDialogOptions({this.initialDirectory, this.confirmButtonText}); | ||
|
|
||
| /// The initial directory the dialog should open with. | ||
| final String? initialDirectory; | ||
|
|
||
| /// The label for the button that confirms selection. | ||
| final String? confirmButtonText; | ||
| } | ||
|
|
||
| /// Configuration options for a save dialog. | ||
| @immutable | ||
| class SaveDialogOptions extends FileDialogOptions { | ||
| /// Creates a new options set with the given settings. | ||
| const SaveDialogOptions( | ||
| {super.initialDirectory, super.confirmButtonText, this.suggestedName}); | ||
|
|
||
| /// The suggested name of the file to save or open. | ||
| final String? suggestedName; | ||
| } |
26 changes: 26 additions & 0 deletions
26
...ages/file_selector/file_selector_platform_interface/lib/src/types/file_save_location.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart' show immutable; | ||
|
|
||
| import 'x_type_group.dart'; | ||
|
|
||
| export 'x_type_group.dart'; | ||
|
|
||
| /// The response from a save dialog. | ||
| @immutable | ||
| class FileSaveLocation { | ||
| /// Creates a result with the given [path] and optional other dialog state. | ||
| const FileSaveLocation(this.path, {this.activeFilter}); | ||
|
|
||
| /// The path to save to. | ||
| final String path; | ||
|
|
||
| /// The currently active filter group, if any. | ||
| /// | ||
| /// This is null on platforms that do not support user-selectable filter | ||
| /// groups in save dialogs (for example, macOS), or when no filter groups | ||
| /// were provided when showing the dialog. | ||
| final XTypeGroup? activeFilter; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this were a major version bump, wouldn't it make this PR much smaller, without really affecting much further ones down the line? (next you'll implement and use the new method, and remove the ignores, but wouldn't it be ~the same amount of work to bump the minimum version of the dependency of this package in the others?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Also, do the "ignores" need to be published to the changed packages?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major version bumps to platform interfaces are unpleasant if there are any third-party implementations, and enabling those is one of the main goals of federation, so we try to minimize them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, ignores are dev-only changes. I need to teach the tooling to do line-level analysis for the version and changelog checks, and ignore non-doc comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an alternative, can you deprecate
getSavePathas a last change to the platform interface, once that every package has been updated to use the new version? Otherwise we're going to be yelling at users without them having an available solution, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our previous workflow was to in theory do it at the end, but in practice we just always forget and nothing gets deprecated :( And we don't even always remember to update all of our own code to use the new methods. So we're trying this flow instead to see how it goes.
Only users who are running analysis on our packages, which I would expect to be nobody.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git push --force then! :P