import 'package:flutter/material.dart'; import '../data/models.dart'; import '../theme/reclaim_tokens.dart'; /// Tier badge — surfaces the lowest evidence tier in a composed /// value. Every figure in the app carries one of these next to it. class TierBadge extends StatelessWidget { const TierBadge({super.key, required this.tier, this.compact = false}); final EvidenceTier tier; final bool compact; @override Widget build(BuildContext context) { final t = Theme.of(context).textTheme; final color = switch (tier) { EvidenceTier.t1 => ReclaimColors.tierT1, EvidenceTier.t2 => ReclaimColors.tierT2, EvidenceTier.t3 => ReclaimColors.tierT3, EvidenceTier.t4 => ReclaimColors.tierT4, }; return Tooltip( message: '${tier.short} — ${tier.description}', child: Container( padding: EdgeInsets.symmetric( horizontal: compact ? 6 : ReclaimSpace.sm, vertical: compact ? 2 : 4, ), decoration: BoxDecoration( color: color.withValues(alpha: 0.18), border: Border.all(color: color.withValues(alpha: 0.55)), borderRadius: const BorderRadius.all(ReclaimRadius.sm), ), child: Row( mainAxisSize: MainAxisSize.min, children: [ Container( width: 6, height: 6, decoration: BoxDecoration( color: color, shape: BoxShape.circle, ), ), const SizedBox(width: 6), Text( tier.short, style: (compact ? t.labelSmall : t.labelLarge)?.copyWith( color: color, fontWeight: FontWeight.w600, ), ), ], ), ), ); } }