Q: emulator always clear moor database I am using drift as database for my flutter app.
Whenever I close the emulator tab and restart it again, then all the saved data are gone.
This is my way to open the database:
LazyDatabase connect() {
  return LazyDatabase(() async {
    final appDir = await getApplicationDocumentsDirectory();
    final dbPath = p.join(appDir.path, 'db.sqlite');

    return NativeDatabase.createInBackground(File(dbPath));
  });
}

It doesn't happen on my own physical device though.
Best regards.
