Skip to content

Instantly share code, notes, and snippets.

@Chinecherem20199
Created May 12, 2022 13:21
Show Gist options
  • Save Chinecherem20199/201ff57de4da99c9985132c8c25c32f6 to your computer and use it in GitHub Desktop.
Save Chinecherem20199/201ff57de4da99c9985132c8c25c32f6 to your computer and use it in GitHub Desktop.
functions_dart
void main() {
var values = [1, 2, 3, 4, 5, 6, 7, 8, 9];
var newVlues = <int>[];
void Function(int) multiply5 = (value) => newVlues.add(value * 5);
listOperation(values, multiply5);
print(newVlues);
}
void listOperation(List<int> list, void Function(int) action) {
for (var item in list) {
action(item);
}
}
@Chinecherem20199
Copy link
Author

function commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment