import 'package:flutter/material.dart'; /// Status bar dot colors matching PRD requirements. enum StatusDotColor { blue, // idle / waiting orange, // submitting green, // success red, // error (invalid code / submit failure / duplicate) yellow, // network error amber, // warning (duplicate box number) } /// Reusable bottom status bar with a colored dot and text. class StatusBar extends StatelessWidget { final StatusDotColor dotColor; final String text; const StatusBar({super.key, required this.dotColor, required this.text}); Color _resolveDotColor(BuildContext context) { return switch (dotColor) { StatusDotColor.blue => Colors.blue, StatusDotColor.orange => Colors.orange, StatusDotColor.green => Colors.green, StatusDotColor.red => Colors.red, StatusDotColor.yellow => Colors.yellow.shade700, StatusDotColor.amber => Colors.amber, }; } @override Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; return Container( width: double.infinity, padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), color: colorScheme.surfaceContainerHighest, child: Row( children: [ Container( width: 7, height: 7, decoration: BoxDecoration( color: _resolveDotColor(context), shape: BoxShape.circle, ), ), const SizedBox(width: 7), Expanded( child: Text( text, style: const TextStyle(fontSize: 12), overflow: TextOverflow.ellipsis, ), ), ], ), ); } }