import 'seed_glyph.dart'; /// A profile avatar is carried in one string (stored locally and published as /// the NIP-01 kind:0 `picture`), in one of three shapes: /// - `data:image/jpeg;base64,…` — a tiny photo thumbnail (rides inline, no /// media server, like offer photos); /// - `tane:seed:` — one of our own seed illustrations (for people who'd /// rather not put a real photo — pseudonymity stays the default); /// - empty — the deterministic coloured disc with the name's initial. const avatarGlyphPrefix = 'tane:seed:'; /// The seed illustrations offered as ready-made avatars. Names are the stable /// storage key (appended to [avatarGlyphPrefix]); the glyphs already ship in /// [SeedGlyphs]. Order is the picker order. const avatarGlyphNames = [ 'jars', 'sack', 'jar', 'scattered', 'pouring', 'mug', 'bigSpoon', 'smallSpoon', ]; /// The glyph char for an avatar illustration [name], or null if unknown. String? avatarGlyphChar(String name) => switch (name) { 'jars' => SeedGlyphs.jars, 'sack' => SeedGlyphs.sack, 'jar' => SeedGlyphs.jar, 'scattered' => SeedGlyphs.scattered, 'pouring' => SeedGlyphs.pouring, 'mug' => SeedGlyphs.mug, 'bigSpoon' => SeedGlyphs.bigSpoon, 'smallSpoon' => SeedGlyphs.smallSpoon, _ => null, }; /// The token that selects illustration [name] (e.g. `tane:seed:jars`). String avatarGlyphToken(String name) => '$avatarGlyphPrefix$name';