import 'package:flutter/material.dart'; import '../i18n/strings.g.dart'; /// One-tap currency chips bound to a free-text [controller]. Ğ1 sits quietly /// among the familiar ones — offered, never imposed — and free text still /// takes anything else (sharing-model §6). Shared by the sale sheet, the lot /// price field and the hand-over sheet so every money-ish input feels the same. class CurrencyQuickPicks extends StatelessWidget { const CurrencyQuickPicks({ required this.controller, required this.keyPrefix, required this.onChanged, super.key, }); final TextEditingController controller; /// Namespaces the chip [Key]s (e.g. `sale` → `sale.currencyChip.€`). final String keyPrefix; /// Fires after a chip toggles the controller text (for `setState`). final VoidCallback onChanged; @override Widget build(BuildContext context) { final t = context.t; return Wrap( spacing: 8, children: [ for (final c in ['€', 'Ğ1', t.sale.hours]) ChoiceChip( key: Key('$keyPrefix.currencyChip.$c'), label: Text(c), selected: controller.text.trim() == c, onSelected: (sel) { controller.text = sel ? c : ''; onChanged(); }, ), ], ); } }