Skip to content
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

getSavePath is deprecated #1910

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ updates:
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "desktop_photo_search/fluent_ui/"
directory: "deeplink_store_example/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "desktop_photo_search/material/"
directory: "desktop_photo_search/fluent_ui/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "experimental/context_menus/"
directory: "desktop_photo_search/material/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "experimental/element_embedding_demo/"
directory: "experimental/context_menus/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
Expand Down Expand Up @@ -161,6 +161,10 @@ updates:
directory: "navigation_and_routing/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "next_gen_ui_demo/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "place_tracker/"
schedule:
Expand Down Expand Up @@ -214,11 +218,11 @@ updates:
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "web_embedding/element_embedding_demo"
directory: "web_embedding/element_embedding_demo/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "web_embedding/ng-flutter/flutter"
directory: "web_embedding/ng-flutter/flutter/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
? PhotoDetails(
photo: photoSearchModel.selectedPhoto!,
onPhotoSave: (photo) async {
final path = await getSavePath(
final saveLocation = await getSaveLocation(
suggestedName: '${photo.id}.jpg',
acceptedTypeGroups: [
const XTypeGroup(
Expand All @@ -58,12 +58,12 @@ class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
),
],
);
if (path != null) {
if (saveLocation != null) {
final fileData =
await photoSearchModel.download(photo: photo);
final photoFile =
XFile.fromData(fileData, mimeType: 'image/jpeg');
await photoFile.saveTo(path);
await photoFile.saveTo(saveLocation.path);
}
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
? PhotoDetails(
photo: photoSearchModel.selectedPhoto!,
onPhotoSave: (photo) async {
final path = await getSavePath(
final saveLocation = await getSaveLocation(
suggestedName: '${photo.id}.jpg',
acceptedTypeGroups: [
const XTypeGroup(
Expand All @@ -60,12 +60,12 @@ class _UnsplashSearchContentState extends State<UnsplashSearchContent> {
),
],
);
if (path != null) {
if (saveLocation != null) {
final fileData =
await photoSearchModel.download(photo: photo);
final photoFile =
XFile.fromData(fileData, mimeType: 'image/jpeg');
await photoFile.saveTo(path);
await photoFile.saveTo(saveLocation.path);
}
},
)
Expand Down
6 changes: 3 additions & 3 deletions experimental/linting_tool/lib/model/profiles_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ 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,
);

final data = Uint8List.fromList(newYamlFile.codeUnits);
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;
}

Expand Down