import 'package:flutter/material.dart'; import '../theme/lawheatmap_tokens.dart'; /// Surface container — visual equivalent of fai_chain_studio's /// `ChainCard`, retuned to the fai_web palette. class LawHeatmapCard extends StatelessWidget { const LawHeatmapCard({ super.key, required this.child, this.padding = const EdgeInsets.all(LawHeatmapSpace.lg), this.accent = false, this.expand = false, }); final Widget child; final EdgeInsetsGeometry padding; /// If true, draws a thin petrol accent bar at the top — /// used for "this card carries a primary action". final bool accent; /// If true, the card grows to fill its parent's bounded /// dimensions and forces the child to expand. Use when the /// card is placed inside an `Expanded` widget and the child /// is itself a free-sizing widget (e.g. CustomPaint). final bool expand; @override Widget build(BuildContext context) { final padded = Padding(padding: padding, child: child); return Card( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: expand ? MainAxisSize.max : MainAxisSize.min, children: [ if (accent) Container( height: 2, decoration: const BoxDecoration( color: LawHeatmapColors.signal, borderRadius: BorderRadius.vertical( top: LawHeatmapRadius.md, ), ), ), if (expand) Expanded(child: padded) else padded, ], ), ); } }