Created
April 20, 2021 10:02
-
-
Save GAM3RG33K/4e92296694c601e357e9dbc74aa34d2e to your computer and use it in GitHub Desktop.
using condition to fill more data in a collection
This file contains hidden or 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
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