-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[file_selector] Update Linux example for deprecations #10542
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,9 @@ class GetMultipleDirectoriesPage extends StatelessWidget { | |||||||||||||||||||||
| Future<void> _getDirectoryPaths(BuildContext context) async { | ||||||||||||||||||||||
| const confirmButtonText = 'Choose'; | ||||||||||||||||||||||
| final List<String> directoryPaths = await FileSelectorPlatform.instance | ||||||||||||||||||||||
| .getDirectoryPaths(confirmButtonText: confirmButtonText); | ||||||||||||||||||||||
| .getDirectoryPathsWithOptions( | ||||||||||||||||||||||
| const FileDialogOptions(confirmButtonText: confirmButtonText), | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
|
Comment on lines
15
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For conciseness, you can inline the
Suggested change
Style Guide ReferencesFootnotes
|
||||||||||||||||||||||
| if (directoryPaths.isEmpty) { | ||||||||||||||||||||||
| // Operation was canceled by the user. | ||||||||||||||||||||||
| return; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
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.
For conciseness, you can inline the
confirmButtonTextconstant directly into theFileDialogOptionsconstructor. This avoids creating a local variable that is only used once, which is a general recommendation in the Dart style guide.1Style Guide References
Footnotes
The repository style guide states that code should follow the relevant style guides for each language. For Dart, this includes following 'Effective Dart' guidelines, which recommend avoiding local variables that are used only once. ↩