getTreeNodeTable method

dynamic getTreeNodeTable(
  1. dynamic tableName,
  2. dynamic item,
  3. dynamic parentid,
  4. dynamic context,
  5. dynamic backcolor,
)

Implementation

getTreeNodeTable(tableName, item, parentid, context, backcolor) {
  myLogAll('getTreeNodeTable');
  List list = getTableRowByParentID(tableName, parentid, context);
  List<TreeNode> result = [];
  if (list.isEmpty) {
    return result;
  }

  for (int i = 0; i < list.length; i++) {
    Map dataRow = list[i];
    var id = dataRow[gId];
    List<TreeNode> listChild =
        getTreeNodeTable(tableName, item, id, context, backcolor);
    result.add(TreeNode(
        content: InkWell(
            child: Row(
              children: [
                getRowItemOne({gTableID: tableName}, dataRow[gId], item,
                    context, backcolor, gTreeView),
                //getImg({gValue: imgDefault}, backcolor),
                MyLabel(
                    {gValue: getTableValueKeyFromTable(tableName, dataRow)},
                    backcolor),
              ],
            ),
            onTap: () {
              sendRequestOne(
                  gLocalAction,
                  {
                    gLabel: gEdit,
                    gAction: gLocalAction,
                    gTableID: tableName,
                    gRow: dataRow
                  },
                  context);
            }),
        children: listChild));
  }
  return result;
}