0

I working on a diary sort of app in Flutter. Entries get saved in a DB. I'm now trying to figure out how I can save the entries to a Textfile. I have tried finding ways to go about that, but nothing so far that seems to fit my needs.

I want to be able to:

  • save database entries to a text file on the device
  • or put the entries as contents in an email.

If anyone can help me in the right direction, I would really appreciate it.

Cheers,

  • check if this works for you https://stackoverflow.com/a/54122851/10409567 – griffins Jul 29 '21 at 11:10
  • Do you just want to convert your database records 1:1 into an CSV? – Superlokkus Jul 29 '21 at 11:33
  • @griffins: Will need to take a further look; however for now it's still unclear to me how to pull the data from the database, and then follow the instructions you've linked to. I will check it out, thanks for the link! – OdinChance Jul 29 '21 at 18:21
  • @Superlokkus Well, csv is a start, but I want to be able to pull the data and send / store it a more legible format. Diary entries etc are not that easy to read in csv format. But, I'll take CSV if there are no other options. – OdinChance Jul 29 '21 at 18:24
  • Then there is already an option in SQLite: https://sqlite.org/cli.html – Superlokkus Jul 29 '21 at 18:26
  • @Superlokkus Thanks! Think I found what is was looking for. – OdinChance Aug 02 '21 at 15:37

0 Answers0