Skip to content

Commit

Permalink
Update outdated example
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellet committed Nov 14, 2023
1 parent dfbb696 commit 2a37387
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions example/lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ class _HomePageState extends State<HomePage> {
if (newImage == null) {
return;
}
if (!isWeb()) {
if (isWeb()) {
controller.insertImageBlock(imageSource: newImage);
return;
}
Expand Down Expand Up @@ -709,8 +709,12 @@ class _HomePageState extends State<HomePage> {
Future<String> _onImagePickCallback(File file) async {
// Copies the picked file from temporary cache to applications directory
final appDocDir = await getApplicationDocumentsDirectory();
final copiedFile =
await file.copy('${appDocDir.path}/${path.basename(file.path)}');
// final copiedFile =
// await file.copy('${appDocDir.path}/${path.basename(file.path)}');
final copiedFile = await file.copy(path.join(
appDocDir.path,
'${DateTime.now().toIso8601String()}${path.extension(file.path)}',
));
return copiedFile.path.toString();
}

Expand Down

0 comments on commit 2a37387

Please sign in to comment.