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 TopSnapshot snapshot = state.snapshot;

  return Column(
    crossAxisAlignment: CrossAxisAlignment.stretch,
    children: [
      _StatusPanel(state: state),
      _MetricsPanels(snapshot: snapshot),
      _DeploymentsPanel(snapshot: snapshot, utc: state.utc),
      Expanded(
        child: _LogsPanel(
          logs: snapshot.logs,
          utc: state.utc,
          scrollController: logScrollController,
        ),
      ),
      ButtonBar(
        buttons: [
          Button(
            name: 'Quit',
            activationChar: 'Q',
            activationKeys: const [LogicalKey.keyQ, LogicalKey.escape],
            onActivate: (final LogicalKey _) {
              onQuit();
            },
          ),
          const Text('↑↓ Scroll logs', style: _dim),
          Text(
            'Refreshing every ${friendlyFormatDuration(state.interval)}',
            style: _dim,
          ),
        ],
      ),
    ],
  );
}