代码之家  ›  专栏  ›  技术社区  ›  Ronny K

如何在flatter中从列表中获取不同的json对象

  •  0
  • Ronny K  · 技术社区  · 5 年前

    我想从flutter和dart中的列表中获得不同的JSON对象。我有这样一个JSON对象列表。我想从每个会话中得到一个基于键的JSON对象 time 最新的。根据与罗尼和詹姆斯的关键对话,得到一个对象。我被困在这几个小时了。有人,请帮帮我。我尝试过使用,for loop,set,compareTo方法,但是我仍然不能掌握它的窍门。谢谢您!

      var data = [{"conversation_with":"ronny","text":"Hello","time":"1610673559273"}, {"conversation_with":"ronny","text":"Hi ronny","time":"1610673166335"}, {"conversation_with":"ronny","text":"how are you","time":"1610730464892"}, {"conversation_with":"ronny","text":"hi ronny","time":"1610673781584"}, {"conversation_with":"james","text":"Hello","time":"1610683918736"}, {"conversation_with":"james","text":"hi james","time":"1610683925522"}];
    
    0 回复  |  直到 5 年前