import 'package:flutter/material.dart'; /// Consistent AppBar builder for TracPulse screens. /// /// Reads base styles (backgroundColor, elevation) from the current /// [ThemeData.appBarTheme], then applies TracPulse's standard back button /// and title styling on top. /// /// Parameters: /// - [title] – App bar title text (left-aligned, monospace, 14px, weight 700, letter-spacing 2) /// - [actions] – optional list of action [IconButton]s placed on the right /// - [onTitleTap] – optional callback when the title is tapped (e.g. Easter egg) AppBar buildTracPulseAppBar({ required String title, List? actions, VoidCallback? onTitleTap, }) { return AppBar( // Inherit backgroundColor, elevation from theme (defined once in MaterialApp.appBarTheme) automaticallyImplyLeading: true, actions: actions, title: onTitleTap != null ? GestureDetector( onTap: onTitleTap, child: Text( title, style: const TextStyle( fontFamily: 'monospace', fontSize: 14, fontWeight: FontWeight.w700, letterSpacing: 2, color: Color(0xFFe0e0e0), ), ), ) : Text( title, style: const TextStyle( fontFamily: 'monospace', fontSize: 14, fontWeight: FontWeight.w700, letterSpacing: 2, color: Color(0xFFe0e0e0), ), ), // Consistent back button: #9e9e9e, size 20 (distinct from title #e0e0e0) leading: Builder( builder: (context) => IconButton( icon: const Icon(Icons.arrow_back, color: Color(0xFF9e9e9e), size: 20), onPressed: () => Navigator.pop(context), ), ), leadingWidth: 48, ); }