Answers for "dart list iterate"

4

foreach loop in list in dart

main() {
    List<String> list = new List<String>();
    list.add('one');
    list.add('two');
    list.add('twelve');
    list.forEach((element) => print(element));

    Set<String> set = Set.from(list);
    set.forEach((element) => print(element));    
}
Posted by: Guest on May-28-2020
1

dart loop through array

for (var i = 0; i < list.length; i++) {
  print(list[i]);
}
Posted by: Guest on August-19-2020
0

stackover flow dart forloop

import 'dart:html';
  import 'dart:async';

  main() async {
  List li = ["-", "\", "|", "/"];
    for (var i = 0; i < 400000000; i++) {
      querySelector('#test').text = li[i % 4];
      (await new Future.delayed(const Duration(seconds: 1)));
    }
  }
Posted by: Guest on December-02-2020

Code answers related to "Dart"

Browse Popular Code Answers by Language