This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[file_selector] Migrate to null safety #3631
Merged
stuartmorgan
merged 6 commits into
flutter:master
from
stuartmorgan:file-selector-nnbd-appfacing
Feb 25, 2021
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f119b50
Update dependencies and version
stuartmorgan 2cce506
Migrate package; replace Mockito with custom fake/mock
stuartmorgan d83a077
Migrate example, and fix null return handling
stuartmorgan 9740846
SDK endorsements
stuartmorgan 3a28758
Merge branch 'master' into file-selector-nnbd-appfacing
stuartmorgan 8ca8203
Make acceptedTypeGroups default to an empty set rather than null
stuartmorgan 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 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 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 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 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 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 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 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 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 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,21 +1,20 @@ | ||
name: file_selector | ||
description: Flutter plugin for opening and saving files. | ||
homepage: https://github.com/flutter/plugins/tree/master/packages/file_selector/file_selector | ||
version: 0.7.0+2 | ||
version: 0.8.0 | ||
|
||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
file_selector_platform_interface: ^1.0.0 | ||
file_selector_platform_interface: ^2.0.0 | ||
|
||
dev_dependencies: | ||
flutter_test: | ||
sdk: flutter | ||
test: ^1.3.0 | ||
mockito: ^4.1.1 | ||
plugin_platform_interface: ^1.0.0 | ||
pedantic: ^1.8.0 | ||
test: ^1.16.3 | ||
plugin_platform_interface: ">=1.0.0 <3.0.0" | ||
pedantic: ^1.10.0 | ||
|
||
environment: | ||
sdk: ">=2.1.0 <3.0.0" | ||
flutter: ">=1.12.13+hotfix.5" | ||
sdk: ">=2.12.0-259.9.beta <3.0.0" | ||
flutter: ">=1.20.0" |
Oops, something went wrong.
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.
optional nits: I'd prefer empty list and empty strings as default none values.
But since the platform interface has already landed, it's probably not worth to go back and introduce a breaking change.
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.
We can make this an empty set without changing the platform interface (and that makes it much easier to change the platform interface later); I'll do that now. I should have caught it during initial review but wasn't as familiar with NNBD migrations yet.
For the strings, I don't think empty strings are valid for this API. An empty initial directory is somewhat ambiguous; is that intended to be the device root, for instance? And there's no fundamental reason someone couldn't decide to make the confirm button blank with an empty string (it would be bad UI design, but so are many other valid strings).
Empty collections are I think almost alway going to be the right choice, but empty strings need real thought about whether there's really no difference between empty and null. Here, that's definitely not the case for most of 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.
(I checked the web implementation, and it already appears to treat empty sets and null the same. This will break one of the unendorsed desktop implementations, but I can fix that trivially.)