getDisplayText method

String getDisplayText(
  1. int row,
  2. int column
)

Gets the display text.

Implementation

String getDisplayText(int row, int column) {
  final CellType valType = type;
  switch (valType) {
    case CellType.blank:
      return '';
    case CellType.text:
      return text!;
    case CellType.number:
    case CellType.dateTime:
      final double? dValue = number;
      return _getNumberOrDateTime(_innerNumberFormat, dValue, row, column);
    case CellType.formula:
      final bool bUpdate = _updateNumberFormat();
      _updateCellValue(worksheet, column, row, true);
      _Format formatImpl;
      if (bUpdate) {
        formatImpl =
            worksheet.workbook.innerFormats[_cellStyle!.numberFormatIndex];
      } else {
        formatImpl = _innerNumberFormat;
      }
      if (text != null) {
        return text!;
      }
      if (number != null || dateTime != null) {
        return _getNumberOrDateTime(formatImpl, number, row, column);
      }
      break;
  }
  return '';
}