iterableDiagonal function

List<String> iterableDiagonal(
  1. List<List<String>> _il,
  2. int sw,
  3. String caller
)

Screen-sized matrix pierced with staggered list elements. Usage: Who is calling this: Effort-ShowUserDiagonal

Implementation

List<String> iterableDiagonal(List<List<String>> _il, int sw, String caller) {
  int _sw = sw; //  screen width.
  int _ilC = tl.countInnerList(_il); //  serves also as row-count.
  int cStep = ((sw - 50) ~/ _ilC); //  spread info to screen.
  //  TODO  More complicated than 1 by 1 system.
  int cInd = 0; //  colon index.

  //  If needed:  int rInd = 0; //  row-index if needed.
  String _s = '';
  String infoS1 = '  INFO: V:Value E:Effort D:Done :  C:$caller';
  String infoS2 = ' ** Diagonal list describing Chore-Effort user-data  **';
  String infoS3 =
      ' - Finally this data is best when get by server to client. -';
  List<String> _ol = [':sh-it-diagL-  First Item    $infoS1 $infoS2 $infoS3'];
  for (var x = 0; x < _il.length; x++) {
    for (var y = 0; y < _il[x].length; y++) {
      _s = '';
      String ts = ''; //  temporary String for padding
      cInd = cInd + cStep;
      ts = _s.padLeft(cInd, '_');
      _s = (ts + _il[x][y]);

      ///  is this really needed??
      //  if needed:  int _wl = _il[x][y].length; //  current item length
      ts = _s.padRight((_sw), '_'); //  to be visible: _
      _ol.add(ts);
      //  empty String
    } //  ---------------    Items in one list.
    cInd + 6; //  extra tick to move column-pos 6 right.
    _ol.add(
        '.--------------------------------'); //TODO  Make something more visible and useful.
  } //  -----------------    All incoming lists.3
  return _ol;
}