dart_stack icon indicating copy to clipboard operation
dart_stack copied to clipboard

toList() not working on iOS

Open Mike-3 opened this issue 1 year ago • 4 comments

There is a compilation exception on iOS. It works on the web and Android.

Mike-3 avatar Dec 07 '24 17:12 Mike-3

Hi @Mike-3 thanks for opening an issue for this

Can you share the exception?

ammaratef45 avatar Dec 11 '24 02:12 ammaratef45

20241217_164106 This is the error essage

Mike-3 avatar Dec 17 '24 15:12 Mike-3

Interesting, would it be possible to share your code so I could try to reproduce it?

ammaratef45 avatar Dec 19 '24 07:12 ammaratef45

void _addTowersOutput(int n, int from, int to) { var output = ''; int offset; var rowCount = max(_towers[0].length, max(_towers[1].length, _towers[2].length)); rowCount = max(2, rowCount);

for (int row = 0; row < rowCount; row++) {
  for (var tower = 0; tower < _towers.length; tower++) {
    offset = rowCount - _towers[tower].length;
    output += (row >= offset
        ? _towers[tower].toList()[_towers[tower].length - 1 - (row - offset)].toString()
        : "|").padLeft(tower == 0 ? 3 : 6);
  }
  output += "\n";
}
towersOutput.add((output.trimRight(), n, from, to));

}

Mike-3 avatar Dec 20 '24 08:12 Mike-3