import 'package:flutter/material.dart'; /// Cyber/IT section header — a short accent bar + an uppercase, letter-spaced /// "telemetry" label, with optional trailing actions. /// /// This is the single shared treatment for in-page section titles (promoted /// from the Dashboard's original `_sectionTitle`). Use it instead of ad-hoc /// bold `Text` sub-headers so every screen's sections read the same way. class AppSectionHeader extends StatelessWidget { const AppSectionHeader( this.title, { super.key, this.trailing, this.padding = const EdgeInsets.only(bottom: 12), }); final String title; /// Optional trailing widget (e.g. a "Show past" button or filter chip), /// pinned to the end of the header row. final Widget? trailing; final EdgeInsetsGeometry padding; @override Widget build(BuildContext context) { final cs = Theme.of(context).colorScheme; return Padding( padding: padding, child: Row( children: [ Container( width: 3, height: 16, decoration: BoxDecoration( color: cs.primary, borderRadius: BorderRadius.circular(2), ), ), const SizedBox(width: 10), Expanded( child: Text( title.toUpperCase(), style: Theme.of(context).textTheme.labelLarge?.copyWith( fontWeight: FontWeight.w700, letterSpacing: 0.8, color: cs.onSurface, ), maxLines: 1, overflow: TextOverflow.ellipsis, ), ), ?trailing, ], ), ); } }