This commit is contained in:
2026-02-10 19:02:21 +08:00
parent 3d29e17225
commit 655e9cd56e
12 changed files with 333 additions and 46 deletions
@@ -177,11 +177,12 @@ object ObjectBox {
}
suspend fun filter(name:String?) = safeDbOp {
var list = getBox<Food>()?.all?.distinctBy { it.name }
val list = getBox<Food>()?.all?.distinctBy { it.name }
if (name.isNullOrBlank().not()) {
list?.filter { it.name?.contains(name!!) == true }
}
list?:emptyList()
list?.filter { it.name?.contains(name) == true }
} else {
list
}?:emptyList()
}
suspend fun remove(name:String) = safeDbOp {