import 'package:flutter/material.dart'; import '../data/models.dart'; import '../theme/lawheatmap_tokens.dart'; import 'tier_badge.dart'; /// A citable source line: tier badge + label + (planned) link. /// External link opening lands with `url_launcher` in week 1 — for /// now the chip surfaces the URL via tooltip + copy hint. class SourceChip extends StatelessWidget { const SourceChip({super.key, required this.source}); final Source source; @override Widget build(BuildContext context) { final t = Theme.of(context).textTheme; return Padding( padding: const EdgeInsets.only(bottom: LawHeatmapSpace.sm), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(top: 2), child: TierBadge(tier: source.tier, compact: true), ), const SizedBox(width: LawHeatmapSpace.sm), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(source.label, style: t.bodyLarge), Text( source.url, style: t.labelSmall?.copyWith( color: LawHeatmapColors.mute, ), ), if (source.note != null) Text( source.note!, style: t.labelSmall?.copyWith( color: LawHeatmapColors.mute, fontStyle: FontStyle.italic, ), ), ], ), ), ], ), ); } }