[英]How to show widget sent from another page based on a condition in flutter
use your custom widget like this:像这样使用您的自定义小部件:
customWidget != null ? Row(children: [customWidget!]) : Container()
Check if the customWidget is null and show it if it's not.检查 customWidget 是否为 null,如果不是则显示。
customWidget ?? Container()
you can use the if
condition like below.您可以使用下面的if
条件。
Row(
children: [
if (customWidget != null) customWidget,
],
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.