title: How to add null value to List generator element?
body: <p>From string I try to make a 2D array list to work as table. Until now below code works perfectly.
  My problem start when I try to get old data from server. I try to modifiy the below code but I keep getting and error as shown below. </p>
  
  <p>The actual data look like this <strong>[01, 10, 04.11.2017, PN-DURUKAN, 18, B, 557.12, 20171014742, E, system, , AB40710000001680].</strong> </p>
  
  <p>If any data is not this format (example if I get a data as <strong>[01, 10, 04.11.2017, ]</strong> I need to put null value into rest and add into my List. How do I do that?</p>
  
  <p><strong>The Error:</strong>
  E/flutter (10127): [ERROR:flutter/shell/common/shell.cc(182)] Dart Error: Unhandled exception:
  E/flutter (10127): RangeError (end): Invalid value: Not in range 302..305, inclusive: 314
  E/flutter (10127): #0      RangeError.checkValidRange (dart:core/errors.dart:325:9)</p>
  
  <p><strong>The Code:</strong></p>
  
  <pre><code>Future&lt;List&lt;List&lt;String&gt;&gt;&gt; _makeTable(mText) async {
    var entries;
    entries = mText.split(":=:");
    if (entries.length &lt; 2) {
      throw ArgumentError.value(mText, "text", "Invalid format");
    }
    int row = int.parse(entries[0]);
    int col = int.parse(entries[1]);
  
    //#####################################
    //TODO: I need to modify below if statement so I can set null value instead of throw an error
    //if (entries.length != 2 + row * col) {
      //throw ArgumentError.value(mText, "text", "Invalid format");
    //}
  
    // List&lt;List&lt;String&gt;&gt; returnArray;
    //returnArray = new List.generate(row, (i) =&gt; entries.sublist(2 + i * col, 2 + (i + 1) * col));
    //#####################################
  
    // ***** MODIFICATION SECTION *******:
    List&lt;List&lt;String&gt;&gt; returnArray;
    for (var i = 0; i &lt; row; i++) {
      var _mValue;
      _mValue = entries.sublist(2 + i * col, 2 + (i + 1) * col);
      print("$_mValue");
    }
    return returnArray;
  }
  </code></pre>
  
  <p><strong>Update the code:</strong></p>
  
  <pre><code>Future&lt;List&lt;List&lt;String&gt;&gt;&gt; _makeTable(mText) async {
    var entries;
    entries = mText.split(":=:");
    if (entries.length &lt; 2) {
      throw ArgumentError.value(mText, "text", "Invalid format");
    }
    int row = int.parse(entries[0]);
    int col = int.parse(entries[1]);
  
    List&lt;List&lt;String&gt;&gt; returnArray = new List&lt;List&lt;String&gt;&gt;();
    for (var i = 0; i &lt; row; i++) {
      var x = 2 + i * col;
      var y = 2 + (i + 1) * col;
  
      if (y &lt;= entries.length) {
        returnArray.insert(i, entries.sublist(x, y));
      }
    }
    return returnArray;
  }
  </code></pre>