xBuilder_XCell method

Widget? xBuilder_XCell(
  1. DataGridCell item,
  2. XDataGridRow xGridDataRow
)

Implementation

Widget? xBuilder_XCell(DataGridCell<dynamic> item, XDataGridRow xGridDataRow) {
  // NULL
  // NULL
  // NULL
  if (item.value == null) {
    return Text("",
        style: XStyles.xStyTextForSubLabel(
          textColor: item_Text_Color ?? (enterpriseMode ? XColors.enterpriseMode_Foreground : XColors.foregroundLight),
        ));
  }
  // String
  // String
  // String
  else {
    if (item.value!.runtimeType == String) {
      return Text(item.value,
          style: XStyles.xStyTextForSubLabel(
            textColor: item_Text_Color ?? (enterpriseMode ? XColors.enterpriseMode_Foreground : XColors.foregroundLight),
          ));
    }
    // BOOL
    // BOOL
    // BOOL
    else if (item.value!.runtimeType == bool) {
      return Container(
          alignment: Alignment.center,
          child: Icon(
            item.value ? Icons.check_box : Icons.check_box_outline_blank_rounded,
            color: item_Text_Color ?? (enterpriseMode ? XColors.enterpriseMode_Foreground : XColors.foregroundLight),
          ));
    }
    // DateTime
    // DateTime
    // DateTime
    else if (item.value!.runtimeType == DateTime) {
      return Text(XUtils.dateToString(item.value, format: "dd MMM yyyy ", noDateLabel: ""), style: XStyles.xStyTextForSubLabel(textColor: item_Text_Color ?? (enterpriseMode ? XColors.enterpriseMode_Foreground : XColors.foregroundLight)));
    }
    // Double
    // Double
    // Double
    else if (item.value!.runtimeType == double) {
      return Text(
        XUtils.xFormatDouble(context, item.value, format: view.cols.firstWhere((x) => x.colKey == item.columnName).format),
        style: XStyles.xStyTextForSubLabel(
          textColor: item_Text_Color ?? (enterpriseMode ? XColors.enterpriseMode_Foreground : XColors.foregroundLight),
        ),
      );
    }
    // Int
    // Int
    // Int
    else if (item.value!.runtimeType == int) {
      return Text(
        XUtils.xFormatInt(context, item.value, format: view.cols.firstWhere((x) => x.colKey == item.columnName).format),
        style: XStyles.xStyTextForSubLabel(
          textColor: item_Text_Color ?? (enterpriseMode ? XColors.enterpriseMode_Foreground : XColors.foregroundLight),
        ),
      );
    }
    // ALTRO
    // ALTRO
    // ALTRO
    // ALTRO
    else {
      return Text(
        item.value.toString(),
        style: XStyles.xStyTextForSubLabel(
          textColor: item_Text_Color ?? (enterpriseMode ? XColors.enterpriseMode_Foreground : XColors.foregroundLight),
        ),
      );
    }
  }
}