export static method

Future<void> export(
  1. String outPath
)

导出文件 outPath 导出文件路径

Implementation

static Future<void> export(String outPath) async {
  var databasesPath = await getDatabasesPath();
  var dbFileNames = [NAME, 'nian.db'];
  for (var name in dbFileNames) {
    String path = join(databasesPath, name);
    File file = File(path);
    if (file.existsSync()) {
      file.copy(outPath + name);
    }
  }
}