Created
July 29, 2022 14:46
-
-
Save ambrizals/c6f09c05c05ae0adefdf423a1607d9bc to your computer and use it in GitHub Desktop.
Yeh Bisa Looping Ternyata
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
void main() { | |
Map<String, String> params = { | |
'test': 'test', | |
'siap': 'ready' | |
}; | |
String url = 'http://domain.com'; | |
int indexP = 0; | |
params.forEach((index, value) { | |
if(indexP == 0) { | |
url = '$url?$index=$value'; | |
} else { | |
url = '$url&$index=$value'; | |
} | |
indexP = indexP + 1; | |
}); | |
print(url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment