使用:
return LazyDatabase(
() async {
var dbFolderPath = '';
if (GetPlatform.isDesktop) {
final provider = PathProviderWindows();
dbFolderPath = (await provider.getApplicationSupportPath())!;
} else {
final dbFolder = await getApplicationDocumentsDirectory();
dbFolderPath = dbFolder.path;
}
final file = File(path.join(dbFolderPath, _databaseName));
debugPrint(file.path);
return NativeDatabase(file);
},
);
Run Code Online (Sandbox Code Playgroud)
只需打印数据库的路径,您就会确切地知道它的存储位置。对我来说,它存储在这个路径中:
颤动:C:\ Users \ USERNAME \ AppData \ Roaming \ PACKAGE_NAME \ debt_record \ db.sqlite
| 归档时间: |
|
| 查看次数: |
3443 次 |
| 最近记录: |