hide database generated by floor flutter

138 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 best solutions below

0
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();
}