How to use conditional statement within child attribute of a Flutter Widget (Center Widget) - Stack Overflow

PHOTO EMBED

Fri May 20 2022 14:41:48 GMT+0000 (Coordinated Universal Time)

Saved by @salim #flutter

Column(
    children: [
        if (_selectedIndex == 0) ...[
          DayScreen(),
        ] else ...[
          StatsScreen(),
        ],
    ],
 ),
content_copyCOPY

if else inside a child

https://stackoverflow.com/questions/49713189/how-to-use-conditional-statement-within-child-attribute-of-a-flutter-widget-cen