【发布时间】:2021-12-11 21:58:18
【问题描述】:
我是飞镖新手,我需要按多个字段分组并获得每个学生的最小值。我不知道如何实施,因为我是飞镖新手。以下是实时 Firebase 表结构的示例。
"gameRanking" : {
"-MmvcDgrGsuCjhcsmXfP" : {
"game" : "Puzzle",
"score" : "105",
"student" : "John Doe",
},
"-MasdDgrGsuCjhcsmXfP" : {
"game" : "Puzzle",
"score" : "99",
"student" : "John Doe",
},
"-Mmw0kagqLrEbdWlkXg7" : {
"game" : "Puzzle",
"score" : "87",
"student" : "Mary Doe",
},
"-MmwC8ONbJUWzP_Wa7X0" : {
"game" : "Puzzle",
"score" : "95",
"student" : "Mary Doe",
}
},
这是预期的输出:
Puzzle John Doe 99
Puzzle Mary Doe 87
【问题讨论】:
-
嗨,欢迎来到 SO。为了更容易帮助您,请包含您已经尝试过的代码,即使它不起作用(只需指出它不起作用的地方)。这样会更容易提供帮助。
-
如果你完全不知道,先看看这个答案:stackoverflow.com/questions/54029370/…
-
你好@Renato,我还没有代码,因为我正在探索dart和flutter。
-
好的,但是你可能应该先花一些精力学习基础知识......了解
Map,具体来说,如何在 Dart 中工作......然后你应该能够提出更有意义的问题. -
我已经看过你提到的链接,但它不适合我的需要。
标签: flutter dart flutter-dependencies dart-null-safety