build method

  1. @override
Component build(
  1. BuildContext context
)

Describes the part of the user interface represented by this component.

Implementation

@override
Component build(BuildContext context) {
  final style = TextStyle(color: color, fontWeight: FontWeight.bold);
  final int cols = _terminalColumns();

  if (cols < _kLogoFullWidth) {
    // Terminal too narrow — show compact single-line fallback.
    return Text(_nitroLogoCompact, style: style);
  }

  // Wrap the full logo in FittedBox so nocterm's layout pass constrains it
  // correctly without any intermediary LayoutBuilder rebuild quirks.
  return FittedBox(
    fit: BoxFit.scaleDown,
    alignment: Alignment.center,
    child: Column(
      children: _nitroLogoLines.map((line) => Text(line, style: style)).toList(),
    ),
  );
}