【发布时间】:2021-09-22 11:36:53
【问题描述】:
我有以下代码:
Get.put(DbController(HabitDao(AppDb())));
当我热重新加载我的应用程序时,我收到以下错误:
"WARNING (moor): It looks like you've created the database class AppDb multiple times. When these two databases use the same QueryExecutor, race conditions will occur and might corrupt the database."
在创建新的AppDb 实例之前,我需要检查我是否放置了DbController。我在使用 Provider 包时从未遇到过这个问题。
解决这个问题的最佳做法是什么?
【问题讨论】:
标签: flutter dart flutter-getx