When I add elements in ObservableList using addAll method and Iterable, It executes the iterables twice. I'm sharing a code snippet that will help to understand the issue.
final list = ObservableList<String>.of([]);
void addItems() {
list.addAll([1,2,3,4].map((e) {
print('$e');
return '$e';
}));
}
/// calling addItems method will Print
/// 1
/// 2
/// 3
/// 4
/// 1
/// 2
/// 3
/// 4
/// but expected output is,
/// 1
/// 2
/// 3
/// 4
Hello,
When I add elements in
ObservableList
usingaddAll
method andIterable
, It executes the iterables twice. I'm sharing a code snippet that will help to understand the issue.