Skip to content

Instantly share code, notes, and snippets.

@GitHubStuff
Created August 28, 2020 21:54
Show Gist options
  • Save GitHubStuff/47ed15b7b8fe92374bb54f91954d530e to your computer and use it in GitHub Desktop.
Save GitHubStuff/47ed15b7b8fe92374bb54f91954d530e to your computer and use it in GitHub Desktop.
Append List of widgets using IF/Spread operator
Column(
children: [
_buildTitle(),
if (showButtons) ..._buildButtons(),
],
)
List<Widget> _buildButtons() {
// ...
}
@GitHubStuff
Copy link
Author

Quick example of using spread "..." operator on IF statement to add list of widgets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment