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 ?? Container()
you can use the if
condition like below.
Row(
children: [
if (customWidget != null) customWidget,
],
),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.