import 'package:flutter/material.dart'; import '../data/models.dart'; import '../theme/reclaim_tokens.dart'; /// Scope badge — surfaces a norm's Geltungsbereich (Berlin / /// Deutschland / EU / International) wherever the norm appears, so /// the reader sees at a glance which reform lever a figure speaks /// to. Visually mirrors [TierBadge]: a scope glyph + code in a /// tinted chip, here with a Material icon instead of a dot. class JurisdictionBadge extends StatelessWidget { const JurisdictionBadge({ super.key, required this.jurisdiction, this.compact = false, }); final Jurisdiction jurisdiction; final bool compact; @override Widget build(BuildContext context) { final t = Theme.of(context).textTheme; final color = switch (jurisdiction) { Jurisdiction.berlin => ReclaimColors.scopeBerlin, Jurisdiction.deutschland => ReclaimColors.scopeDeutschland, Jurisdiction.eu => ReclaimColors.scopeEu, Jurisdiction.international => ReclaimColors.scopeInternational, }; final icon = switch (jurisdiction) { Jurisdiction.berlin => Icons.location_city_outlined, Jurisdiction.deutschland => Icons.flag_outlined, Jurisdiction.eu => Icons.star_outline_rounded, Jurisdiction.international => Icons.public, }; final label = compact ? jurisdiction.short : '${jurisdiction.short} · ${jurisdiction.label}'; return Tooltip( message: 'Geltungsbereich: ${jurisdiction.label} ' '(${jurisdiction.level}).\n${jurisdiction.reformLever}.', 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: [ Icon(icon, size: compact ? 12 : 14, color: color), const SizedBox(width: 6), Text( label, style: (compact ? t.labelSmall : t.labelLarge)?.copyWith( color: color, fontWeight: FontWeight.w600, ), ), ], ), ), ); } }