我正在使用 flutter SQflite 在 flutter 中存储数据,到目前为止我没有问题。现在我想用它更新我的应用程序和数据库。到目前为止,我只是用新数据库替换旧数据库。但是现在有一些表我想保留数据(用户数据)。如何替换某些表并保留其他表?(到目前为止表结构没有变化)编辑:我正在使用 SQlite 的 DB 浏览器在颤振之外创建和填充数据库(当然,应用程序数据中的用户除外)
Future<void> initDatabase() async {
var databasesPath = await getDatabasesPath();
var path = join(databasesPath, "recipes.db");
// Check if the database exists
var exists = await databaseExists(path);
if (!exists) {
// Should happen only the first time you launch your application
print("Creating new copy of database from asset");
// Make sure the parent directory exists
try {
await Directory(dirname(path)).create(recursive: true);
} catch (_) {}
// Copy from asset
ByteData data = await …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将现有的Flutter应用程序迁移到web。问题是某些软件包与 Web 不兼容(例如 path_provider 和许多其他软件包)。
\n我真的不想构建一个全新的项目,那么有没有办法排除web的某些依赖项?无法\xe2\x80\x99 找不到任何关于此的内容。
\n