显示总共113条中的前3条
Tried to use Provider with a subtype of Listenable/Stream (MerchantUserProfileProvider).
发布者 : 粮油菜大市场 发布时间 : 23 Nov 2021 17:45:11
Tried to use Provider with a subtype of Listenable/Stream (MerchantUserProfileProvider).
flutter Unhandled Exception: type 'int' is not a subtype of type 'String'
发布者 : 粮油菜大市场 发布时间 : 23 Nov 2021 02:37:24
Unhandled Exception: type 'int' is not a subtype of type 'String'
latitude = double.parse(json['latitude']);本来以为这个可以把int转换成double,原来只能是转换String
看来得用json['latitude'].toDouble()方法了
Looking up a deactivated widget's ancestor is unsafe. flutter
发布者 : 粮油菜大市场 发布时间 : 23 Nov 2021 01:08:31
Looking up a deactivated widget's ancestor is unsafe.
_model.saveMerchantProfile(_formData).then((_) {
Navigator.of(context).pop();
if (_model.errorMsg != null) {
showClzDialog(
context, _model.errorMsg!,
onPressFuction: () {
Navigator.of(context).pop();
});
}
});
究其原因,大概是Navigator.of(context).pop();把这个页面的context给销毁了,下面的dialog就找不到context了,改成下面的情况就好了
model.saveMerchantProfile(_formData).then((_) { showClzDialog(context, _model.errorMsg ?? '保存成功', onPressFuction: () { Navigator.of(context).pop(); }); });