displayWidth property

int get displayWidth

Calculate the display width of this item in terminal cells.

Implementation

int get displayWidth => switch (this) {
  _TextStatusItem(:final text) => text.length,
  _KeyHintStatusItem(:final key, :final action) =>
    key.length + 1 + action.length,
  _ProgressStatusItem(:final current, :final total) => _progressText(
    current,
    total,
  ).length,
  _SpinnerStatusItem() => 1,
  _SpacerStatusItem() => 0,
  _WidgetStatusItem() => 0,
};