8000 [file_selector] Minor update to example app (#850) · google/flutter-desktop-embedding@1d3bff4 · GitHub < 8000 link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon">
[go: up one dir, main page]

Skip to content

Commit 1d3bff4

Browse files
[file_selector] Minor update to example app (#850)
- Add suggested filename to save dialog (this was a bug in the example, which was copied from file_selector, whose examples were written on web where that is a no-op, so was missed). - Update dependencies, and update null handling as a result of the fix that was recently made to cross-file.
1 parent 57a2cd8 commit 1d3bff4

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

plugins/file_selector/example/lib/open_image_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class OpenImagePage extends StatelessWidget {
1313
final files = await FileSelectorPlatform.instance
1414
.openFiles(acceptedTypeGroups: [typeGroup]);
1515
final file = files[0];
16-
final fileName = file.name!;
17-
final filePath = file.path!;
16+
final fileName = file.name;
17+
final filePath = file.path;
1818

1919
await showDialog(
2020
context: context,

plugins/file_selector/example/lib/open_multiple_images_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class MultipleImagesDisplay extends StatelessWidget {
6666
...files.map(
6767
(file) => Flexible(
6868
child: kIsWeb
69-
? Image.network(file.path!)
70-
: Image.file(File(file.path!))),
69+
? Image.network(file.path)
70+
: Image.file(File(file.path))),
7171
)
7272
],
7373
),

plugins/file_selector/example/lib/open_text_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class OpenTextPage extends StatelessWidget {
1313
if (file == null) {
1414
return;
1515
}
16-
final fileName = file.name!;
16+
final fileName = file.name;
1717
final fileContent = await file.readAsString();
1818

1919
await showDialog(

plugins/file_selector/example/lib/save_text_page.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ class SaveTextPage extends StatelessWidget {
88
final TextEditingController _contentController = TextEditingController();
99

1010
void _saveFile() async {
11-
final path = await FileSelectorPlatform.instance.getSavePath();
11+
final fileName = _nameController.text;
12+
final path = await FileSelectorPlatform.instance.getSavePath(
13+
suggestedName: fileName,
14+
);
1215
if (path == null) {
1316
return;
1417
}
1518
final text = _contentController.text;
16-
final fileName = _nameController.text;
1719
final fileData = Uint8List.fromList(text.codeUnits);
1820
const fileMimeType = 'text/plain';
1921
final textFile =

plugins/file_selector/example/pubspec.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ packages:
4949
name: cross_file
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "0.3.0"
52+
version: "0.3.1+1"
5353
fake_async:
5454
dependency: transitive
5555
description:
@@ -70,14 +70,14 @@ packages:
7070
path: "../file_selector_macos"
7171
relative: true
7272
source: path
73-
version: "0.0.3"
73+
version: "0.0.4"
7474
file_selector_platform_interface:
7575
dependency: "direct main"
7676
description:
7777
name: file_selector_platform_interface
7878
url: "https://pub.dartlang.org"
7979
source: hosted
80-
version: "2.0.0"
80+
version: "2.0.2"
8181
file_selector_windows:
8282
dependency: "direct main"
8383
description:
@@ -101,7 +101,7 @@ packages:
101101
name: http
102102
url: "https://pub.dartlang.org"
103103
source: hosted
104-
version: "0.13.0"
104+
version: "0.13.1"
105105
http_parser:
106106
dependency: transitive
107107
description:
@@ -136,7 +136,7 @@ packages:
136136
name: pedantic
137137
url: "https://pub.dartlang.org"
138138
source: hosted
139-
version: "1.10.0"
139+
version: "1.11.0"
140140
plugin_platform_interface:
141141
dependency: transitive
142142
description:
@@ -155,7 +155,7 @@ packages:
155155
name: source_span
156156
url: "https://pub.dartlang.org"
157157
source: hosted
158-
version: "1.8.0"
158+
version: "1.8.1"
159159
stack_trace:
160160
dependency: transitive
161161
description:
@@ -190,7 +190,7 @@ packages:
190190
name: test_api
191191
url: "https://pub.dartlang.org"
192192
source: hosted
193-
version: "0.2.19"
193+
version: "0.3.0"
194194
typed_data:
195195
dependency: transitive
196196
description:
@@ -206,5 +206,5 @@ packages:
206206
source: hosted
207207
version: "2.1.0"
208208
sdks:
209-
dart: ">=2.12.0-259.9.beta <3.0.0"
209+
dart: ">=2.12.0 <3.0.0"
210210
flutter: ">=1.22.0"

plugins/file_selector/example/windows/flutter/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ add_custom_command(
9090
COMMAND ${CMAKE_COMMAND} -E env
9191
${FLUTTER_TOOL_ENVIRONMENT}
9292
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
93-
windows-x64 $<CONFIG>
93+
windows-x64 $<CONFIG>
94+
VERBATIM
9495
)
9596
add_custom_target(flutter_assemble DEPENDS
9697
"${FLUTTER_LIBRARY}"

0 commit comments

Comments
 (0)
0