From 2a373874858f0b15128aded9e9def7521bb50d0e Mon Sep 17 00:00:00 2001 From: Ellet Date: Tue, 14 Nov 2023 08:42:56 +0300 Subject: [PATCH] Update outdated example --- example/lib/pages/home_page.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/example/lib/pages/home_page.dart b/example/lib/pages/home_page.dart index 8c0c37a75..6252c09ab 100644 --- a/example/lib/pages/home_page.dart +++ b/example/lib/pages/home_page.dart @@ -506,7 +506,7 @@ class _HomePageState extends State { if (newImage == null) { return; } - if (!isWeb()) { + if (isWeb()) { controller.insertImageBlock(imageSource: newImage); return; } @@ -709,8 +709,12 @@ class _HomePageState extends State { Future _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(); }