Skip to content
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
Empty file removed -
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'package:file_selector/file_selector.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path_provider/path_provider.dart' as path_provider;

/// Page for showing an example of saving with file_selector
class SaveTextPage extends StatelessWidget {
Expand All @@ -21,9 +21,11 @@ class SaveTextPage extends StatelessWidget {
final String fileName = _nameController.text;
// This demonstrates using an initial directory for the prompt, which should
// only be done in cases where the application can likely predict where the
// file will be saved. In most cases, this parameter should not be provided.
final String initialDirectory =
(await getApplicationDocumentsDirectory()).path;
// file will be saved. In most cases, this parameter should not be provided,
// and in the web, path_provider shouldn't even be called.
final String? initialDirectory = kIsWeb
? null
: (await path_provider.getApplicationDocumentsDirectory()).path;
final FileSaveLocation? result = await getSaveLocation(
initialDirectory: initialDirectory,
suggestedName: fileName,
Expand Down