刚尝试运行,我收到此错误:
JSONException:CourseDivide没有值 StatisticsFragment $ ByEntire.onPostExecute(StatisticsFragment.java:225) StatisticsFragment $ ByEntire.onPostExecute(StatisticsFragment.java:153)
我是Java的初学者,我似乎无法弄清楚JSONException没有价值的原因。
代码:
import 'dart:async';
import 'package:flutter/material.dart';
void _imageLoad() async {
String imageName = "";
Image downloadImage = new Image.network(imageName);
final ImageStream stream = downloadImage.image.resolve(ImageConfiguration.empty);
final Completer<void> completer = Completer<void>();
stream.addListener((ImageInfo info, bool syncCall) => completer.complete());
await completer.future;
if (mounted) {
//do sth
}
}
答案 0 :(得分:0)
可能是您的JSON没有courseDivide或有误,请删除')'
courseDivide = object.getInt("courseDivide");
coursePersonnel = object.getInt("coursePersonnel");
courseTime = object.getString("courseTime");