import 'package:flutter/widgets.dart'; import 'package:lucide_icons_flutter/lucide_icons.dart'; /// A glyph per state, keyed by the backend's state code. /// /// ── Why the state and not the district ── /// /// The first version of this marked every *district*: Chennai a capital, /// Coimbatore a factory, Tiruppur knitwear, and so on down a flat list of /// twelve. It scanned well at twelve. It does not survive sixty — and more to /// the point, it put the app in the business of having an opinion about every /// district in India, which is a table nobody can keep honest and a mistake /// somebody eventually finds offensive. /// /// There are twenty-eight states. Giving each one a mark is a bounded problem, /// the marks stay recognisable, and the district list underneath is left as /// what it should be: names and delivery promises, nothing competing with them. /// /// ── The rule each glyph follows ── /// /// One thing about the place that a person living in India would recognise, /// and never a religious building — a temple state drawn as a church is worse /// than no icon at all. These are editorial choices, not data: they are meant /// to be argued with and changed, which is why they are one table in one file. /// /// ── The fallback is the contract ── /// /// [stateMark] answers for every code, including ones that do not exist yet. /// The serviceable list is the backend's, so a state opened there appears here /// immediately — with the pin, looking deliberate, until somebody adds a line. /// Nothing renders blank and nothing throws. Adding a state is one entry; /// forgetting to is not a bug. const Map _marks = { 'TN': LucideIcons.landmark, // the gopuram silhouette 'KL': LucideIcons.treePalm, // the backwaters 'KA': LucideIcons.crown, // the Mysuru palace 'AP': LucideIcons.mountain, // the eastern ghats 'TG': LucideIcons.castle, // the Golconda fort 'MH': LucideIcons.ship, // the Bombay harbour 'GA': LucideIcons.sailboat, 'PY': LucideIcons.waves, }; /// The mark for a state code, or a pin for one nobody has named yet. IconData stateMark(String? stateCode) => _marks[stateCode] ?? LucideIcons.mapPin;