hide database generated by floor flutter

129 views Asked by At

I found that user can manually delete floor generated db file in application folder.

Is it possible to hide the db file generated by the floor package or change the path?

1

There are 1 answers

0
Moïse Rajesearison On BEST ANSWER

One of my coworkers has found the solution.

The way is just to add a dot before db name.

Here is the code.

static Future<AppDatabase> getInstance() async {
   return await $FloorAppDatabase.databaseBuilder(".stim.db").build();
}