1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

desktop_photo_search: getSavePath is deprecated (#1910)

This PR fixes a [CI
breakage](https://github.com/flutter/samples/actions/runs/5362518576/jobs/9729453534):

```console
Analyzing fluent_ui...

   info - lib/src/widgets/unsplash_search_content.dart:51:38 - 'getSavePath' is deprecated and shouldn't be used. Use getSaveLocation instead. Try replacing the use of the deprecated member with the replacement. - deprecated_member_use

1 issue found.
Error: Process completed with exit code 1.
```

## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel
channel on [Discord].

<!-- Links -->
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[CLA]: https://cla.developers.google.com/
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Contributors Guide]:
https://github.com/flutter/samples/blob/main/CONTRIBUTING.md
This commit is contained in:
Brett Morgan
2023-06-25 10:44:16 +10:00
committed by GitHub
parent 5ec584e819
commit eac6afac14
4 changed files with 19 additions and 15 deletions

View File

@@ -140,7 +140,7 @@ class ProfilesStore extends ChangeNotifier {
const name = 'analysis_options.yaml';
/// Get file path using file picker.
final savePath = await file_selector.getSavePath(
final saveLocation = await file_selector.getSaveLocation(
suggestedName: name,
);
@@ -148,8 +148,8 @@ class ProfilesStore extends ChangeNotifier {
final file = file_selector.XFile.fromData(data, name: name);
/// Save file to disk if path was provided.
if (savePath != null) {
await file.saveTo(savePath);
if (saveLocation != null) {
await file.saveTo(saveLocation.path);
return true;
}