Closed UNIcodeX closed 3 years ago
I get the following error when running the attached code.
D/FileSaver(19385): Save as Method Called D/Dialog Activity(19385): Opening File Manager D/Dialog Activity(19385): Starting file operation D/Dialog Activity(19385): Trying to save file D/Dialog Activity(19385): Saving file D/Dialog Activity(19385): Something went wrong I/flutter (19385): File Successfully Saved 30 W/System (19385): A resource failed to call close.
void export() async { // SETTINGS BOX Map mapSettingsData = {}; Box boxSettingsData = Hive.box(boxSettings); for (var key in boxSettingsData.keys) { mapSettingsData[key] = boxSettingsData.get(key); } debug("SETTINGS:\n" + prettyJson(mapSettingsData)); // WRITE THE FILES final _appDirPath = await appDirPath; final fileSettings = File("$_appDirPath/settings.json"); if (isMobile) { await Permission.storage.request(); var status = await Permission.storage.status; if (status.isDenied) { await Permission.storage.request(); } } TextEditingController fileSaveTextController = TextEditingController(); final fileSettingsAsBytes = fileSettings.readAsBytesSync(); final fs = FileSaver(); await fs.saveAs( fileSaveTextController.text == "" ? "app_name" : fileSaveTextController.text, fileSettingsAsBytes, "txt", MimeType.TEXT); }
I don't see there anything related to this plugin? Wrong repo?
oh crap... that's embarrasing. I must have had this up in a tab next to the other project. Thanks. 🤦🏽
No problem, it happens 😄
I get the following error when running the attached code.