Open popeyelau opened 3 years ago
Widget buildItems() { List<Widget> sectionA = [Text("A")]; List<Widget> sectionB = [Text("B")]; return Column( children: [ ...sectionA, ...sectionB, ], ); }
Widget buildItems() { List<Widget> sectionA = [Text("A")]; List<Widget> sectionB = [Text("B")]; bool showSectionB = false; return Column( children: [ ...sectionA, if (showSectionB) ...sectionB, ], ); }
Widget buildItems() { List<Widget> sectionA = [Text("A")]; List<Widget> sectionB = [Text("B")]; List<int> sectionC = [1, 2, 3, 4, 5]; bool showSectionB = false; return Column( children: [ ...sectionA, if (showSectionB) ...sectionB, for (var number in sectionC) if (number.isEven) Text(number.toString()) ], ); }
spread
if
for in