上传头像
Future getImage() async { var image = await ImagePicker.pickImage(source: ImageSource.gallery); ItemDao.UpLoad(image).then((res){ if(res['resultCode'] == 'ok'){ setState(() { url = res['fileId']; }); }else{ Fluttertoast.showToast( msg: res['codeDesc'], backgroundColor: Color(GSYColors.toastBg), textColor: Color(GSYColors.titleBlack)); return; } }).catchError((e){ print(e.toString()); }); setState(() { if (image != null) _image = image; }); }