'How to show widget sent from another page based on a condition in flutter
Solution 1:[1]
use your custom widget like this:
customWidget != null ? Row(children: [customWidget!]) : Container()
Solution 2:[2]
Check if the customWidget is null and show it if it's not.
customWidget ?? Container()
Solution 3:[3]
you can use the if condition like below.
Row(
children: [
if (customWidget != null) customWidget,
],
),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | reza |
| Solution 2 | Dani3le_ |
| Solution 3 | nagendra nag |

