What makes this a fixed-length list in Dart?
<pre><code> List&lt;String&gt; checkLength(List&lt;String&gt; input) {
  if (input.length &gt; 6) {
    var tempOutput = input;
    while (tempOutput.length &gt; 6) {
      var difference = (tempOutput.length/6).round() + 1;
      for (int i = 0; i &lt; tempOutput.length - 1; i + difference) {
        tempOutput.removeAt(i); //Removing the value from the list
      }
    }
    return tempOutput; //Return Updated list
  } else {
    return input;
  }
}
</code></pre>

<p>I am trying to delete something out of a temporary list. Why does it not work? I do not see how it is fixed, in other problems I have solved, I used a similar approach and it worked (Even identical nearly)</p>

<p>Please note I am kind of new to Dart, so please forgive me this sort of question, but I couldn't figure out the solution.</p>

<p>Find the Code available in the Dart Link</p>

<p><a href="https://dartpad.dartlang.org/ccf4288b3f9b5ef391ff784720d06801" rel="noreferrer">Code in Dart</a></p>