flutterdartflutter-floor

hide database generated by floor flutter


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?


Solution

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