Skip to content

Instantly share code, notes, and snippets.

@Deleplace
Created August 26, 2022 14:25
Show Gist options
  • Save Deleplace/ba0a840363eda2fbb464b0a6b7f9bde0 to your computer and use it in GitHub Desktop.
Save Deleplace/ba0a840363eda2fbb464b0a6b7f9bde0 to your computer and use it in GitHub Desktop.
Iterate over list indexes and values

Iterate over list indexes and values

Created with <3 with dartpad.dev.

import 'package:collection/collection.dart';
main() {
final items = ['a', 'b'];
items.forEachIndexed((i, value) {
print('index=$i, value=$value');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment