How to loop through a list of elements by index in Dart

1 Answer

0 votes
void main() {
    List<int> lst = [21, 32, 11, 71, 97]; 
    
    for (var i = 0; i < lst.length; i++) {
        print(lst[i]);
    }
}




/*
run:

21
32
11
71
97

*/

 



answered Oct 8, 2022 by avibootz

Related questions

4 answers 328 views
328 views asked Apr 22, 2023 by avibootz
1 answer 183 views
1 answer 154 views
1 answer 208 views
1 answer 143 views
...