getTableHeader method

dynamic getTableHeader(
  1. dynamic name,
  2. dynamic context
)

Implementation

getTableHeader(name, context) {
  myLogAll('getTableHeader');

  var focusName = _mFocusNode[gName] ?? '';
  var value = getTableHeaderValue(name, context);
  if (isNull(focusName) && isNull(value)) {
    return const SizedBox();
  }
  if (name != focusName && isNull(value)) {
    return const SizedBox();
  }
  if (_tableList[name] == null && isNull(value)) {
    return const SizedBox();
  }
  //value = getTableHeaderValue(name, context);
  var id = _mFocusNode[gId] ?? '';
  if (isNull(id) && isNull(value)) {
    return const SizedBox();
  }
  var dataRow = getTableRowByID(name, id);
  if (isNull(dataRow) && isNull(value)) {
    return const SizedBox();
  }
  value = '${getTableKeyword(name, id, context, -1)}$value';
  if (isNull(value)) {
    return const SizedBox();
  }
  int backgroundcolor = Colors.white.value;

  Widget w = MyLabel(
      {gLabel: value, gFontSize: _defaultFontSize, gAlign: TextAlign.left},
      backgroundcolor);
  if (getIsPos()) {
    w = SizedBox(
      width: MediaQuery.of(context).size.width - 50.0,
      child: SingleChildScrollView(
        scrollDirection: Axis.horizontal,
        child: Row(children: [
          MyButton({
            gLabel: gTablePrint,
            gAction: gLocalAction,
            //gType: gPrintTable,
            gTableID: name,
            gCharacter: true,
            /*gWidth: getDouble(
                (getCharLength({gLabel: gTablePrint}) + 20.0).toString()),*/
          }),
          const SizedBox(width: 10.0),
          /*MyIcon({
            gAction: gLocalAction,
            gLabel: gTablePrint,
            gType: gTable,
            gTableID: name,
            gValue: 0xf2ce,
            gIconSize: iconSize,
          }),*/
          w
        ]),
      ),
    );
  }

  return w;
  /*List<Widget> actionList = [];
  actionList.insert(
      0,
      Expanded(
          child: MyLabel({gLabel: value, gFontSize: 10.0}, backgroundcolor)));
  return Row(
    children: actionList,
  );*/
}