【发布时间】:2021-05-24 00:58:18
【问题描述】:
我使用 Hive 和 Flutter 将联系人存储为字母数字字符串,每个联系人数据都是一个带有时间戳的地图
方框行 =
Key. => Value
'abc123' => {'name': 'JK', 'country':'GB', 'timestamp': '568'},
'etergb' => {'name': 'FS', 'country':'DE', 'timestamp': '425'}
'546hfg' => {'name': 'TD', 'country':'GB', 'timestamp': '687'}
现在可以使用 where country=GB 条件过滤这些并按 map.item.timestamp ASC/DESC 对行进行排序
【问题讨论】:
-
所以该值为
List<Map<String,Map<String,String>>>?或者顶层只是带有 abc123 之类的键的 Map。你想重新排序什么......地图没有排序。 :) -
Hive 尚不支持原生排序和过滤。如果你想这样做,你必须自己在代码中手动完成。
标签: flutter dart flutter-hive