I have a page that I use in common. I'm posting a "widget" named "custom widget" on this page. If "custom widget" is sent I want to show it. If it's not sent, don't do anything. How can I achieve this?
CodePudding user response:
use your custom widget like this:
customWidget != null ? Row(children: [customWidget!]) : Container()
CodePudding user response:
Check if the customWidget is null and show it if it's not.
customWidget ?? Container()
CodePudding user response:
you can use the if condition like below.
Row(
children: [
if (customWidget != null) customWidget,
],
),

