如何在Map中使用fromJson列表?

时间:2018-04-30 10:15:45

标签: dart flutter

通常,我会使用此代码进行列表。

  <dependency>
     <groupId>org.junit.platform</groupId>
     <artifactId>junit-platform-launcher</artifactId>
     <version>${junit.platform.version}</version>
     <scope>test</scope>
  </dependency>

但我不知道如何使用fromJson。

This is a picture of my code.

1 个答案:

答案 0 :(得分:1)

我通过使用解决了这个问题。

List.castFrom(json['galleries']).map((gallery) => new Gallery.fromJson(gallery)).toList();
相关问题