'See the whole length of a printed into console list

I've printed a very long array (about 2k lenght) into console. Unfortunately console cut it and I can't see the whole content, how can I see the entire list? My purpose is to use the content into another file in the project.

Thanks all



Solution 1:[1]

Use

https://stackoverflow.com/a/54122851/12103616 or

main() async {
  List letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"];
  File file = new File("Letters.txt");
  for (int i = 0; i < 10; i++) {
    await file.writeAsString("${letters[i]}", mode: FileMode.append);
  }
}

Solution 2:[2]

You may take the array.toString() in a string variable and can check the length of the string. Now you can according to the length being printed on the console, print the subString(s) of that string using for loop. This might be one way.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sergi
Solution 2 Ankit Kumar Maurya