hi,
i'm currently developing a flutter app for a Master's degree course related to the developing process like branches usage, etc.
The app basically gives the possibility to keep track of expenses in the plain text accounting way.
I'm developing this app "Plain Wallet" with other 3 my colleagues and we would like to publish it on F-Droid.
rWe recognize the efforts of others so there is no doubt that we are going to mention your package on the about page that is in the app also if we will use the app just for us.
Now i explain why i opened this issue.
I already implemented the select current file by using another package and now i need to create one if the user doesn't upload one.
i was looking for a flutter package to do that found your project which looks perfect for that.
I implemented a method createFile() which create a example.journal in the app folder and then i call the PickOrSave().fileSaver and i pass as filePath the file.path value. when the PickOrSave().fileSaver is called the app shows the file manager and at the bottom a text field where i can specify the file name.
In my case i see "example" and not "example.journal". It happens also if i specify the field fileName.
After saving the file in the selected folder i delete the file which is in the app folder.
I store the path which is in result[0] in the sshared preferences and then
static Future<void> createFile(
ScaffoldMessengerState scaffoldMessenger) async {
bool hasPermission = await prepareStorage();
if (!hasPermission) {
return;
}
Directory? plainWalletDir = await getExternalStorageDirectory();
File file = File("${plainWalletDir?.path}/example.journal");
await file.writeAsString("");
List<String>? result = await PickOrSave().fileSaver(
params: FileSaverParams(
localOnly: true,
saveFiles: [SaveFileInfo(filePath: file.path, fileName:"file.journal")],
));
file.delete();
print("file deleted");
print("result to string: $result");
String savedFilePath = result![0];
print("saved savedFilePath value: $savedFilePath");
storeSelectedFilePath(savedFilePath);
scaffoldMessenger.showSnackBar(
const SnackBar(content: Text('File created in the download folder')),
);
}
when i tap on the button which uses this function i have this logs:
D/PickOrSavePlugin( 7295): Saving file on background...
D/PickOrSavePlugin( 7295): Saving file '/storage/emulated/0/Android/data/com.example.app/files/example.journal' to '/document/primary:Download/file'
I/gralloc4( 7295): unregister: id=21d00000977
W/libEGL ( 7295): EGLNativeWindowType 0xb4000076f29b4ef0 disconnect failed
I/gralloc4( 7295): register: id=21d00000978
D/PickOrSavePlugin( 7295): Saved file to '/document/primary:Download/file'
D/PickOrSavePlugin( 7295): ...saved file on background, result: /document/primary:Download/file
I/System.out( 7295): fileSaving result cleared
I/System.out( 7295): Elapsed time in nanoseconds: 49250000
I/gralloc4( 7295): register: id=21d00000979
I/flutter ( 7295): file deleted
I/flutter ( 7295): result to string: [/document/primary:Download/file]
I/flutter ( 7295): saved savedFilePath value: /document/primary:Download/file
As you can see the file is saved but without an extension. I tried to use different extensions like the examples in the flutter package's page but it doesn't show.
The goal is to save the file with the extensionthat in my case is ".journal so the output should be a file created/saved like "name"+".journal" .
Best regards,
Rocco R.
hi,
i'm currently developing a flutter app for a Master's degree course related to the developing process like branches usage, etc.
The app basically gives the possibility to keep track of expenses in the plain text accounting way.
I'm developing this app "Plain Wallet" with other 3 my colleagues and we would like to publish it on F-Droid.
rWe recognize the efforts of others so there is no doubt that we are going to mention your package on the about page that is in the app also if we will use the app just for us.
Now i explain why i opened this issue.
I already implemented the select current file by using another package and now i need to create one if the user doesn't upload one.
i was looking for a flutter package to do that found your project which looks perfect for that.
I implemented a method createFile() which create a example.journal in the app folder and then i call the PickOrSave().fileSaver and i pass as filePath the file.path value. when the PickOrSave().fileSaver is called the app shows the file manager and at the bottom a text field where i can specify the file name.
In my case i see "example" and not "example.journal". It happens also if i specify the field fileName.
After saving the file in the selected folder i delete the file which is in the app folder.
I store the path which is in result[0] in the sshared preferences and then
when i tap on the button which uses this function i have this logs:
As you can see the file is saved but without an extension. I tried to use different extensions like the examples in the flutter package's page but it doesn't show.
The goal is to save the file with the extensionthat in my case is ".journal so the output should be a file created/saved like "name"+".journal" .
Best regards,
Rocco R.