In C like languages like JS, its a common operation to assign a value to an array in a for
loop at a given index using []. Like this:
With Dart lang trying this:
You get the error: RangeError (index): Index out of range: no indices are valid: 0
The solution is to use List's insert method .insert(i, value)
or .add(value)
.
Top comments (0)