如何将JSON资产加载到Flutter应用程序中?

时间:2019-09-20 03:32:42

标签: flutter

String data = await DefaultAssetBundle.of(context).loadString("assets/data.json");
final jsonResult = json.decode(data);

1 个答案:

答案 0 :(得分:0)

您遇到什么问题?

您可以尝试以下方法:

<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-actuator-autoconfigure</artifactId>
     <version>2.1.8.RELEASE</version>
     <scope>compile</scope>
 </dependency>
 <dependency>
     <groupId>io.micrometer</groupId>
     <artifactId>micrometer-core</artifactId>
     <version>1.1.6</version>
     <scope>runtime</scope>
 </dependency>