Skip to content

Instantly share code, notes, and snippets.

@ambrizals
Created July 29, 2022 14:46
Show Gist options
  • Save ambrizals/c6f09c05c05ae0adefdf423a1607d9bc to your computer and use it in GitHub Desktop.
Save ambrizals/c6f09c05c05ae0adefdf423a1607d9bc to your computer and use it in GitHub Desktop.
Yeh Bisa Looping Ternyata
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