繁体   English   中英

Flutter 错误:在 null 上调用了 getter 'height'

[英]Flutter Error: The getter 'height' was called on null

我正在尝试使用以下代码库调整图像大小: https://gist.github.com/Maciejfiedler/2c5554ef1643fbd15183b7effc64338e在我的真实设备上,

The getter 'height' was called on null.

Receiver: null

Tried calling: height

我想显示这个调整大小的图像。

参数size未传递给Thumbnail()

Dart 分析仪可以帮助避免此类错误,如果您使用@required标记必须具有的关键参数:

const Thumbnail({
   Key key,
   @required this.size, 
   @required this.image}) : super(key: key);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM