Skip to content

Instantly share code, notes, and snippets.

@GAM3RG33K
Created April 20, 2021 10:02
Show Gist options
  • Save GAM3RG33K/4e92296694c601e357e9dbc74aa34d2e to your computer and use it in GitHub Desktop.
Save GAM3RG33K/4e92296694c601e357e9dbc74aa34d2e to your computer and use it in GitHub Desktop.
using condition to fill more data in a collection
void main() {
_executeProcess1();
_executeProcess1(isAdvanced: true);
}
void _executeProcess1({bool isAdvanced = false}){
final list1 = [
1,2,3,4, if(isAdvanced)...[5,6,7,8,9,10,],];
print('_executeProcess1: isAdvanced:${isAdvanced}: \n$list1');
final map1 = {
'key1': 1,
'key2': 2,
'key3': 3,
'key4': 4,
'key5': 5,
if(isAdvanced)...{
'key6': 6,
'key7': 7,
'key8': 8,
'key9': 9,
'key10': 10,
},
};
print('_executeProcess1: isAdvanced:${isAdvanced}: \n$map1');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment