Created
August 28, 2020 21:54
-
-
Save GitHubStuff/47ed15b7b8fe92374bb54f91954d530e to your computer and use it in GitHub Desktop.
Append List of widgets using IF/Spread operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Column( | |
children: [ | |
_buildTitle(), | |
if (showButtons) ..._buildButtons(), | |
], | |
) | |
List<Widget> _buildButtons() { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick example of using spread "..." operator on IF statement to add list of widgets