Add custom themes, holiday themes, chat backgrounds and holiday animations

- Themes: name + background + accent, derived surfaces/text/bubbles; editor
  with live preview; share codes and .jsonl import/export
- Theme icons: swap tab, send, settings, node avatar and map marker icons for
  named icons or pictures (lossless JPEG XL)
- Chat backgrounds per channel/DM (color or JPEG XL picture with fade);
  themes can set one, optionally for every chat
- Map follows custom themes (panels, accent, tile tint, markers)
- Holiday themes (Halloween, Thanksgiving, Christmas, New Year's) with
  generated backgrounds, icons and map markers; automatic switching from
  17 days before each holiday
- Holiday greeting animations (bats, turkeys, Santa, fireworks) matched
  across all app languages via translation strings
This commit is contained in:
zjs81 committed 2026-10-31 13:43:34 -07:00
1 parent 780183b586
commit 4a574185e8
124 files changed
+12686 -292

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+96
View File
@@ -0,0 +1,96 @@
/// Animation trigger messages: holiday greetings that play a short
/// full-screen animation when they arrive in (or are sent to) an open chat.
///
/// The greetings are translation strings (`holidayGreeting_*` in the ARB
/// files, alternatives separated by `|`). A message is checked against the
/// greetings of *every* app language, since the sender may write in any of
/// them, and matching ignores case and punctuation.
library;
import 'dart:ui' show Locale;
import '../l10n/app_localizations.dart';
enum HolidayAnimation { halloween, thanksgiving, christmas, newYear }
/// The greeting string for [animation] in one language.
String holidayGreetingsIn(AppLocalizations l10n, HolidayAnimation animation) =>
switch (animation) {
HolidayAnimation.halloween => l10n.holidayGreeting_halloween,
HolidayAnimation.thanksgiving => l10n.holidayGreeting_thanksgiving,
HolidayAnimation.christmas => l10n.holidayGreeting_christmas,
HolidayAnimation.newYear => l10n.holidayGreeting_newYear,
};
final RegExp _apostrophes = RegExp("['’‘`´]");
final RegExp _nonWord = RegExp(r'[^\p{L}\p{N}]+', unicode: true);
/// Scripts written without spaces between words; their greetings are
/// matched anywhere in the text.
final RegExp _unspacedScript = RegExp(r'[぀-ヿ㐀-鿿豈-﫿]');
/// Lowercase, without apostrophes, with every run of punctuation or spaces
/// turned into a single space.
String _normalize(String text) => text
.toLowerCase()
.replaceAll(_apostrophes, '')
.replaceAll(_nonWord, ' ')
.trim();
class _Matcher {
final HolidayAnimation animation;
/// Whole-word phrase with surrounding spaces, e.g. " happy new year ".
final String spaced;
/// The phrase with spaces removed, for hashtags and unspaced scripts.
final String joined;
final bool unspaced;
_Matcher(this.animation, String normalized)
: spaced = ' $normalized ',
joined = normalized.replaceAll(' ', ''),
unspaced = _unspacedScript.hasMatch(normalized);
}
/// Matchers for every greeting in every supported language.
List<_Matcher> _buildMatchers() {
final seen = <(HolidayAnimation, String)>{};
final matchers = <_Matcher>[];
for (final locale in AppLocalizations.supportedLocales) {
final l10n = lookupAppLocalizations(Locale(locale.languageCode));
for (final animation in HolidayAnimation.values) {
for (final phrase in holidayGreetingsIn(l10n, animation).split('|')) {
final normalized = _normalize(phrase);
// Skip blanks and greetings too short to be meaningful on their own.
if (normalized.replaceAll(' ', '').length < 3) continue;
if (seen.add((animation, normalized))) {
matchers.add(_Matcher(animation, normalized));
}
}
}
}
return matchers;
}
final List<_Matcher> _matchers = _buildMatchers();
/// The animation [text] triggers, or null. Greetings must be whole words
/// ("feliz natalia" is not "feliz natal"), except in scripts written
/// without spaces. A greeting run together as one word ("#HappyNewYear")
/// also counts.
HolidayAnimation? holidayAnimationFor(String text) {
if (text.isEmpty) return null;
final normalized = _normalize(text);
if (normalized.isEmpty) return null;
final spaced = ' $normalized ';
final joined = normalized.replaceAll(' ', '');
for (final m in _matchers) {
if (m.unspaced) {
if (joined.contains(m.joined)) return m.animation;
} else if (spaced.contains(m.spaced) || spaced.contains(' ${m.joined} ')) {
return m.animation;
}
}
return null;
}
+5 -1
View File
@@ -3455,5 +3455,9 @@
"networkMap_manage": "Управление",
"networkMap_addedToContacts": "Добавено към контактите",
"networkMap_addFailed": "Неуспешно добавяне към контактите",
"networkMap_unnamed": "Неназован повторител"
"networkMap_unnamed": "Неназован повторител",
"holidayGreeting_halloween": "Честит Хелоуин|Весел Хелоуин",
"holidayGreeting_thanksgiving": "Честит Ден на благодарността",
"holidayGreeting_christmas": "Весела Коледа|Честито Рождество",
"holidayGreeting_newYear": "Честита Нова година|Щастлива Нова година"
}
+5 -1
View File
@@ -3590,5 +3590,9 @@
"networkMap_manage": "Verwalten",
"networkMap_addedToContacts": "Zu Kontakten hinzugefügt",
"networkMap_addFailed": "Hinzufügen zu Kontakten fehlgeschlagen",
"networkMap_unnamed": "Unbenannter Repeater"
"networkMap_unnamed": "Unbenannter Repeater",
"holidayGreeting_halloween": "Frohes Halloween|Fröhliches Halloween",
"holidayGreeting_thanksgiving": "Frohes Thanksgiving|Schönes Thanksgiving|Frohes Erntedankfest",
"holidayGreeting_christmas": "Frohe Weihnachten|Fröhliche Weihnachten",
"holidayGreeting_newYear": "Frohes neues Jahr|Gutes neues Jahr|Guten Rutsch|Prosit Neujahr"
}
+129 -1
View File
@@ -360,6 +360,118 @@
"appSettings_themeSystem": "System default",
"appSettings_themeLight": "Light",
"appSettings_themeDark": "Dark",
"appSettings_colorTheme": "Color theme",
"appSettings_holidayAnimations": "Holiday message animations",
"appSettings_holidayAnimationsSubtitle": "Bats, a turkey, Santa or fireworks when someone sends a holiday greeting",
"themes_title": "Themes",
"themes_default": "MeshCore",
"themes_defaultSubtitle": "Standard colors, follows the Light / Dark setting",
"themes_builtIn": "Built-in",
"themes_holidays": "Holidays",
"themes_holidayAutoSwitch": "Switch automatically",
"themes_holidayAutoSwitchSubtitle": "Uses each holiday's theme from 17 days before until the day itself",
"themes_holidayAutoApplied": "{holiday} theme is on automatically. Your own theme comes back after the holiday.",
"@themes_holidayAutoApplied": {
"placeholders": {
"holiday": {
"type": "String"
}
}
},
"themes_holidayAutoAppliedTag": "On automatically",
"themes_myThemes": "My themes",
"themes_myThemesEmpty": "Make your own theme by picking a background and an accent color.",
"themes_create": "Create theme",
"themes_import": "Import theme",
"themes_importHint": "Paste a theme code",
"themes_importInvalid": "That is not a valid theme code",
"themes_imported": "Added theme \"{name}\"",
"@themes_imported": {
"placeholders": {
"name": {
"type": "String"
}
}
},
"themes_customize": "Customize a copy",
"themes_copyCode": "Copy theme code",
"themes_codeCopied": "Theme code copied",
"themes_deleteConfirm": "Delete theme \"{name}\"?",
"@themes_deleteConfirm": {
"placeholders": {
"name": {
"type": "String"
}
}
},
"themes_copyName": "{name} copy",
"@themes_copyName": {
"placeholders": {
"name": {
"type": "String"
}
}
},
"themes_newTitle": "New theme",
"themes_editTitle": "Edit theme",
"themes_name": "Name",
"themes_nameRequired": "Give your theme a name",
"themes_background": "Background",
"themes_backgroundHelp": "A dark background makes a dark theme",
"themes_accent": "Accent",
"themes_accentHelp": "Buttons, highlights and your chat bubbles",
"themes_hexColor": "Hex color",
"themes_preview": "Preview",
"themes_previewIncoming": "Anyone on the mesh tonight?",
"themes_previewOutgoing": "Loud and clear!",
"themes_previewSwitch": "Notifications",
"themes_lowContrast": "The accent is hard to see on this background",
"themes_saveAndUse": "Save and use",
"themes_icons": "Icons",
"themes_iconsHelp": "Tap an icon to swap it for another icon or your own picture",
"themes_iconChanged": "Changed",
"themes_iconSend": "Send button",
"themes_iconRepeater": "Repeaters",
"themes_iconRoom": "Rooms",
"themes_iconSensor": "Sensors",
"themes_mapMarkers": "Map markers",
"themes_mapMarkersHelp": "Swap the markers for nodes and for you on the map",
"themes_iconUsePicture": "Use a picture",
"themes_iconReset": "Use the default icon",
"themes_iconPictureFailed": "Could not use that picture",
"themes_exportFile": "Export to file",
"themes_exportAll": "Export my themes",
"themes_importFile": "Import from file",
"themes_pasteCode": "Paste theme code",
"themes_exportFailed": "Could not export themes",
"themes_importFileResult": "Imported {count} themes",
"@themes_importFileResult": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"themes_importFileNone": "No themes found in that file",
"chatBackground_title": "Chat background",
"chatBackground_thisChatOnly": "Only for this chat",
"chatBackground_themeOverrides": "Your theme \"{name}\" sets the background in every chat. Turn that off in the theme to use this one.",
"@chatBackground_themeOverrides": {
"placeholders": {
"name": {
"type": "String"
}
}
},
"chatBackground_none": "None",
"chatBackground_picture": "Picture",
"chatBackground_choosePicture": "Choose a picture",
"chatBackground_pictureFailed": "Could not use that picture",
"chatBackground_fade": "Fade",
"themes_chatBackground": "Chat background",
"themes_chatBackgroundHelp": "Shown in chats that do not have their own background",
"themes_chatBackgroundEverywhere": "Use in every chat",
"themes_chatBackgroundEverywhereHelp": "Also replaces backgrounds set on individual chats",
"appSettings_language": "Language",
"appSettings_languageSystem": "System default",
"appSettings_languageEn": "English",
@@ -3624,5 +3736,21 @@
"networkMap_manage": "Manage",
"networkMap_addedToContacts": "Added to contacts",
"networkMap_addFailed": "Couldn't add to contacts",
"networkMap_unnamed": "Unnamed repeater"
"networkMap_unnamed": "Unnamed repeater",
"holidayGreeting_halloween": "Happy Halloween",
"@holidayGreeting_halloween": {
"description": "Holiday greeting that plays the Halloween bats animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |."
},
"holidayGreeting_thanksgiving": "Happy Thanksgiving",
"@holidayGreeting_thanksgiving": {
"description": "Holiday greeting that plays the Thanksgiving turkey animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |."
},
"holidayGreeting_christmas": "Merry Christmas|Merry Xmas|Happy Christmas",
"@holidayGreeting_christmas": {
"description": "Holiday greeting that plays the Christmas Santa animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |."
},
"holidayGreeting_newYear": "Happy New Year|Happy New Year's",
"@holidayGreeting_newYear": {
"description": "Holiday greeting that plays the New Year's fireworks animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |."
}
}
+5 -1
View File
@@ -3589,5 +3589,9 @@
},
"networkMap_sourceLocalHint": "Nodos que tu radio ha escuchado",
"networkMap_sourceOnlineHint": "Repetidores del mapa de red en línea",
"networkMap_sourceBothHint": "Los nodos de tu radio más el mapa de red en línea"
"networkMap_sourceBothHint": "Los nodos de tu radio más el mapa de red en línea",
"holidayGreeting_halloween": "Feliz Halloween|Feliz Noche de Brujas",
"holidayGreeting_thanksgiving": "Feliz Día de Acción de Gracias|Feliz Thanksgiving",
"holidayGreeting_christmas": "Feliz Navidad",
"holidayGreeting_newYear": "Feliz Año Nuevo|Próspero Año Nuevo"
}
+5 -1
View File
@@ -3589,5 +3589,9 @@
},
"networkMap_sourceLocalHint": "Nœuds entendus par votre radio",
"networkMap_sourceOnlineHint": "Répéteurs de la carte du réseau en ligne",
"networkMap_sourceBothHint": "Les nœuds de votre radio plus la carte du réseau en ligne"
"networkMap_sourceBothHint": "Les nœuds de votre radio plus la carte du réseau en ligne",
"holidayGreeting_halloween": "Joyeux Halloween|Joyeuse Halloween",
"holidayGreeting_thanksgiving": "Joyeux Thanksgiving|Joyeuse Action de grâce",
"holidayGreeting_christmas": "Joyeux Noël",
"holidayGreeting_newYear": "Bonne année"
}
+5 -1
View File
@@ -3494,5 +3494,9 @@
"networkMap_manage": "Kezelés",
"networkMap_addedToContacts": "Hozzáadva a kapcsolatokhoz",
"networkMap_addFailed": "Nem sikerült hozzáadni a kapcsolatokhoz",
"networkMap_unnamed": "Névtelen repeater"
"networkMap_unnamed": "Névtelen repeater",
"holidayGreeting_halloween": "Boldog Halloweent|Boldog Halloween",
"holidayGreeting_thanksgiving": "Boldog hálaadást",
"holidayGreeting_christmas": "Boldog karácsonyt",
"holidayGreeting_newYear": "Boldog új évet"
}
+5 -1
View File
@@ -3589,5 +3589,9 @@
},
"networkMap_sourceLocalHint": "Nodi sentiti dalla tua radio",
"networkMap_sourceOnlineHint": "Ripetitori dalla mappa di rete online",
"networkMap_sourceBothHint": "I nodi della tua radio più la mappa di rete online"
"networkMap_sourceBothHint": "I nodi della tua radio più la mappa di rete online",
"holidayGreeting_halloween": "Buon Halloween|Felice Halloween",
"holidayGreeting_thanksgiving": "Buon Ringraziamento|Buon Thanksgiving",
"holidayGreeting_christmas": "Buon Natale",
"holidayGreeting_newYear": "Felice Anno Nuovo|Buon Anno Nuovo|Buon Capodanno"
}
+5 -1
View File
@@ -3589,5 +3589,9 @@
},
"networkMap_sourceLocalHint": "ラジオが受信したノード",
"networkMap_sourceOnlineHint": "オンラインネットワークマップのリピータ",
"networkMap_sourceBothHint": "ラジオのノードとオンラインネットワークマップ"
"networkMap_sourceBothHint": "ラジオのノードとオンラインネットワークマップ",
"holidayGreeting_halloween": "ハッピーハロウィン|ハッピーハロウィーン",
"holidayGreeting_thanksgiving": "ハッピーサンクスギビング|感謝祭おめでとう",
"holidayGreeting_christmas": "メリークリスマス",
"holidayGreeting_newYear": "あけましておめでとう|明けましておめでとう|ハッピーニューイヤー"
}
+5 -1
View File
@@ -3589,5 +3589,9 @@
},
"networkMap_sourceLocalHint": "내 라디오가 수신한 노드",
"networkMap_sourceOnlineHint": "온라인 네트워크 지도의 리피터",
"networkMap_sourceBothHint": "내 라디오의 노드와 온라인 네트워크 지도"
"networkMap_sourceBothHint": "내 라디오의 노드와 온라인 네트워크 지도",
"holidayGreeting_halloween": "해피 할로윈|즐거운 할로윈",
"holidayGreeting_thanksgiving": "해피 땡스기빙|즐거운 추수감사절|행복한 추수감사절",
"holidayGreeting_christmas": "메리 크리스마스|즐거운 성탄절",
"holidayGreeting_newYear": "새해 복 많이 받으세요|새해 복 많이 받아|해피 뉴 이어"
}
+444
View File
@@ -1564,6 +1564,426 @@ abstract class AppLocalizations {
/// **'Dark'**
String get appSettings_themeDark;
/// No description provided for @appSettings_colorTheme.
///
/// In en, this message translates to:
/// **'Color theme'**
String get appSettings_colorTheme;
/// No description provided for @appSettings_holidayAnimations.
///
/// In en, this message translates to:
/// **'Holiday message animations'**
String get appSettings_holidayAnimations;
/// No description provided for @appSettings_holidayAnimationsSubtitle.
///
/// In en, this message translates to:
/// **'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting'**
String get appSettings_holidayAnimationsSubtitle;
/// No description provided for @themes_title.
///
/// In en, this message translates to:
/// **'Themes'**
String get themes_title;
/// No description provided for @themes_default.
///
/// In en, this message translates to:
/// **'MeshCore'**
String get themes_default;
/// No description provided for @themes_defaultSubtitle.
///
/// In en, this message translates to:
/// **'Standard colors, follows the Light / Dark setting'**
String get themes_defaultSubtitle;
/// No description provided for @themes_builtIn.
///
/// In en, this message translates to:
/// **'Built-in'**
String get themes_builtIn;
/// No description provided for @themes_holidays.
///
/// In en, this message translates to:
/// **'Holidays'**
String get themes_holidays;
/// No description provided for @themes_holidayAutoSwitch.
///
/// In en, this message translates to:
/// **'Switch automatically'**
String get themes_holidayAutoSwitch;
/// No description provided for @themes_holidayAutoSwitchSubtitle.
///
/// In en, this message translates to:
/// **'Uses each holiday\'s theme from 17 days before until the day itself'**
String get themes_holidayAutoSwitchSubtitle;
/// No description provided for @themes_holidayAutoApplied.
///
/// In en, this message translates to:
/// **'{holiday} theme is on automatically. Your own theme comes back after the holiday.'**
String themes_holidayAutoApplied(String holiday);
/// No description provided for @themes_holidayAutoAppliedTag.
///
/// In en, this message translates to:
/// **'On automatically'**
String get themes_holidayAutoAppliedTag;
/// No description provided for @themes_myThemes.
///
/// In en, this message translates to:
/// **'My themes'**
String get themes_myThemes;
/// No description provided for @themes_myThemesEmpty.
///
/// In en, this message translates to:
/// **'Make your own theme by picking a background and an accent color.'**
String get themes_myThemesEmpty;
/// No description provided for @themes_create.
///
/// In en, this message translates to:
/// **'Create theme'**
String get themes_create;
/// No description provided for @themes_import.
///
/// In en, this message translates to:
/// **'Import theme'**
String get themes_import;
/// No description provided for @themes_importHint.
///
/// In en, this message translates to:
/// **'Paste a theme code'**
String get themes_importHint;
/// No description provided for @themes_importInvalid.
///
/// In en, this message translates to:
/// **'That is not a valid theme code'**
String get themes_importInvalid;
/// No description provided for @themes_imported.
///
/// In en, this message translates to:
/// **'Added theme \"{name}\"'**
String themes_imported(String name);
/// No description provided for @themes_customize.
///
/// In en, this message translates to:
/// **'Customize a copy'**
String get themes_customize;
/// No description provided for @themes_copyCode.
///
/// In en, this message translates to:
/// **'Copy theme code'**
String get themes_copyCode;
/// No description provided for @themes_codeCopied.
///
/// In en, this message translates to:
/// **'Theme code copied'**
String get themes_codeCopied;
/// No description provided for @themes_deleteConfirm.
///
/// In en, this message translates to:
/// **'Delete theme \"{name}\"?'**
String themes_deleteConfirm(String name);
/// No description provided for @themes_copyName.
///
/// In en, this message translates to:
/// **'{name} copy'**
String themes_copyName(String name);
/// No description provided for @themes_newTitle.
///
/// In en, this message translates to:
/// **'New theme'**
String get themes_newTitle;
/// No description provided for @themes_editTitle.
///
/// In en, this message translates to:
/// **'Edit theme'**
String get themes_editTitle;
/// No description provided for @themes_name.
///
/// In en, this message translates to:
/// **'Name'**
String get themes_name;
/// No description provided for @themes_nameRequired.
///
/// In en, this message translates to:
/// **'Give your theme a name'**
String get themes_nameRequired;
/// No description provided for @themes_background.
///
/// In en, this message translates to:
/// **'Background'**
String get themes_background;
/// No description provided for @themes_backgroundHelp.
///
/// In en, this message translates to:
/// **'A dark background makes a dark theme'**
String get themes_backgroundHelp;
/// No description provided for @themes_accent.
///
/// In en, this message translates to:
/// **'Accent'**
String get themes_accent;
/// No description provided for @themes_accentHelp.
///
/// In en, this message translates to:
/// **'Buttons, highlights and your chat bubbles'**
String get themes_accentHelp;
/// No description provided for @themes_hexColor.
///
/// In en, this message translates to:
/// **'Hex color'**
String get themes_hexColor;
/// No description provided for @themes_preview.
///
/// In en, this message translates to:
/// **'Preview'**
String get themes_preview;
/// No description provided for @themes_previewIncoming.
///
/// In en, this message translates to:
/// **'Anyone on the mesh tonight?'**
String get themes_previewIncoming;
/// No description provided for @themes_previewOutgoing.
///
/// In en, this message translates to:
/// **'Loud and clear!'**
String get themes_previewOutgoing;
/// No description provided for @themes_previewSwitch.
///
/// In en, this message translates to:
/// **'Notifications'**
String get themes_previewSwitch;
/// No description provided for @themes_lowContrast.
///
/// In en, this message translates to:
/// **'The accent is hard to see on this background'**
String get themes_lowContrast;
/// No description provided for @themes_saveAndUse.
///
/// In en, this message translates to:
/// **'Save and use'**
String get themes_saveAndUse;
/// No description provided for @themes_icons.
///
/// In en, this message translates to:
/// **'Icons'**
String get themes_icons;
/// No description provided for @themes_iconsHelp.
///
/// In en, this message translates to:
/// **'Tap an icon to swap it for another icon or your own picture'**
String get themes_iconsHelp;
/// No description provided for @themes_iconChanged.
///
/// In en, this message translates to:
/// **'Changed'**
String get themes_iconChanged;
/// No description provided for @themes_iconSend.
///
/// In en, this message translates to:
/// **'Send button'**
String get themes_iconSend;
/// No description provided for @themes_iconRepeater.
///
/// In en, this message translates to:
/// **'Repeaters'**
String get themes_iconRepeater;
/// No description provided for @themes_iconRoom.
///
/// In en, this message translates to:
/// **'Rooms'**
String get themes_iconRoom;
/// No description provided for @themes_iconSensor.
///
/// In en, this message translates to:
/// **'Sensors'**
String get themes_iconSensor;
/// No description provided for @themes_mapMarkers.
///
/// In en, this message translates to:
/// **'Map markers'**
String get themes_mapMarkers;
/// No description provided for @themes_mapMarkersHelp.
///
/// In en, this message translates to:
/// **'Swap the markers for nodes and for you on the map'**
String get themes_mapMarkersHelp;
/// No description provided for @themes_iconUsePicture.
///
/// In en, this message translates to:
/// **'Use a picture'**
String get themes_iconUsePicture;
/// No description provided for @themes_iconReset.
///
/// In en, this message translates to:
/// **'Use the default icon'**
String get themes_iconReset;
/// No description provided for @themes_iconPictureFailed.
///
/// In en, this message translates to:
/// **'Could not use that picture'**
String get themes_iconPictureFailed;
/// No description provided for @themes_exportFile.
///
/// In en, this message translates to:
/// **'Export to file'**
String get themes_exportFile;
/// No description provided for @themes_exportAll.
///
/// In en, this message translates to:
/// **'Export my themes'**
String get themes_exportAll;
/// No description provided for @themes_importFile.
///
/// In en, this message translates to:
/// **'Import from file'**
String get themes_importFile;
/// No description provided for @themes_pasteCode.
///
/// In en, this message translates to:
/// **'Paste theme code'**
String get themes_pasteCode;
/// No description provided for @themes_exportFailed.
///
/// In en, this message translates to:
/// **'Could not export themes'**
String get themes_exportFailed;
/// No description provided for @themes_importFileResult.
///
/// In en, this message translates to:
/// **'Imported {count} themes'**
String themes_importFileResult(int count);
/// No description provided for @themes_importFileNone.
///
/// In en, this message translates to:
/// **'No themes found in that file'**
String get themes_importFileNone;
/// No description provided for @chatBackground_title.
///
/// In en, this message translates to:
/// **'Chat background'**
String get chatBackground_title;
/// No description provided for @chatBackground_thisChatOnly.
///
/// In en, this message translates to:
/// **'Only for this chat'**
String get chatBackground_thisChatOnly;
/// No description provided for @chatBackground_themeOverrides.
///
/// In en, this message translates to:
/// **'Your theme \"{name}\" sets the background in every chat. Turn that off in the theme to use this one.'**
String chatBackground_themeOverrides(String name);
/// No description provided for @chatBackground_none.
///
/// In en, this message translates to:
/// **'None'**
String get chatBackground_none;
/// No description provided for @chatBackground_picture.
///
/// In en, this message translates to:
/// **'Picture'**
String get chatBackground_picture;
/// No description provided for @chatBackground_choosePicture.
///
/// In en, this message translates to:
/// **'Choose a picture'**
String get chatBackground_choosePicture;
/// No description provided for @chatBackground_pictureFailed.
///
/// In en, this message translates to:
/// **'Could not use that picture'**
String get chatBackground_pictureFailed;
/// No description provided for @chatBackground_fade.
///
/// In en, this message translates to:
/// **'Fade'**
String get chatBackground_fade;
/// No description provided for @themes_chatBackground.
///
/// In en, this message translates to:
/// **'Chat background'**
String get themes_chatBackground;
/// No description provided for @themes_chatBackgroundHelp.
///
/// In en, this message translates to:
/// **'Shown in chats that do not have their own background'**
String get themes_chatBackgroundHelp;
/// No description provided for @themes_chatBackgroundEverywhere.
///
/// In en, this message translates to:
/// **'Use in every chat'**
String get themes_chatBackgroundEverywhere;
/// No description provided for @themes_chatBackgroundEverywhereHelp.
///
/// In en, this message translates to:
/// **'Also replaces backgrounds set on individual chats'**
String get themes_chatBackgroundEverywhereHelp;
/// No description provided for @appSettings_language.
///
/// In en, this message translates to:
@@ -11046,6 +11466,30 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Unnamed repeater'**
String get networkMap_unnamed;
/// Holiday greeting that plays the Halloween bats animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |.
///
/// In en, this message translates to:
/// **'Happy Halloween'**
String get holidayGreeting_halloween;
/// Holiday greeting that plays the Thanksgiving turkey animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |.
///
/// In en, this message translates to:
/// **'Happy Thanksgiving'**
String get holidayGreeting_thanksgiving;
/// Holiday greeting that plays the Christmas Santa animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |.
///
/// In en, this message translates to:
/// **'Merry Christmas|Merry Xmas|Happy Christmas'**
String get holidayGreeting_christmas;
/// Holiday greeting that plays the New Year's fireworks animation when it appears in a chat message. Matched in every app language and ignoring case and punctuation, so translate it as people actually write the greeting. Separate alternative phrasings with |.
///
/// In en, this message translates to:
/// **'Happy New Year|Happy New Year\'s'**
String get holidayGreeting_newYear;
}
class _AppLocalizationsDelegate
+244
View File
@@ -830,6 +830,237 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get appSettings_themeDark => 'Тъмна';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Език';
@@ -6602,4 +6833,17 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get networkMap_unnamed => 'Неназован повторител';
@override
String get holidayGreeting_halloween => 'Честит Хелоуин|Весел Хелоуин';
@override
String get holidayGreeting_thanksgiving => 'Честит Ден на благодарността';
@override
String get holidayGreeting_christmas => 'Весела Коледа|Честито Рождество';
@override
String get holidayGreeting_newYear =>
'Честита Нова година|Щастлива Нова година';
}
+247
View File
@@ -825,6 +825,237 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get appSettings_themeDark => 'Dunkel';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Sprache';
@@ -6610,4 +6841,20 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get networkMap_unnamed => 'Unbenannter Repeater';
@override
String get holidayGreeting_halloween =>
'Frohes Halloween|Fröhliches Halloween';
@override
String get holidayGreeting_thanksgiving =>
'Frohes Thanksgiving|Schönes Thanksgiving|Frohes Erntedankfest';
@override
String get holidayGreeting_christmas =>
'Frohe Weihnachten|Fröhliche Weihnachten';
@override
String get holidayGreeting_newYear =>
'Frohes neues Jahr|Gutes neues Jahr|Guten Rutsch|Prosit Neujahr';
}
+244
View File
@@ -812,6 +812,237 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get appSettings_themeDark => 'Dark';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Language';
@@ -6505,4 +6736,17 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get networkMap_unnamed => 'Unnamed repeater';
@override
String get holidayGreeting_halloween => 'Happy Halloween';
@override
String get holidayGreeting_thanksgiving => 'Happy Thanksgiving';
@override
String get holidayGreeting_christmas =>
'Merry Christmas|Merry Xmas|Happy Christmas';
@override
String get holidayGreeting_newYear => 'Happy New Year|Happy New Year\'s';
}
+245
View File
@@ -824,6 +824,237 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get appSettings_themeDark => 'Oscuro';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Idioma';
@@ -6601,4 +6832,18 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get networkMap_unnamed => 'Repetidor sin nombre';
@override
String get holidayGreeting_halloween =>
'Feliz Halloween|Feliz Noche de Brujas';
@override
String get holidayGreeting_thanksgiving =>
'Feliz Día de Acción de Gracias|Feliz Thanksgiving';
@override
String get holidayGreeting_christmas => 'Feliz Navidad';
@override
String get holidayGreeting_newYear => 'Feliz Año Nuevo|Próspero Año Nuevo';
}
+244
View File
@@ -830,6 +830,237 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get appSettings_themeDark => 'Sombre';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Langue';
@@ -6623,4 +6854,17 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get networkMap_unnamed => 'Répéteur sans nom';
@override
String get holidayGreeting_halloween => 'Joyeux Halloween|Joyeuse Halloween';
@override
String get holidayGreeting_thanksgiving =>
'Joyeux Thanksgiving|Joyeuse Action de grâce';
@override
String get holidayGreeting_christmas => 'Joyeux Noël';
@override
String get holidayGreeting_newYear => 'Bonne année';
}
+243
View File
@@ -823,6 +823,237 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get appSettings_themeDark => 'Sötét';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Nyelv';
@@ -6588,4 +6819,16 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get networkMap_unnamed => 'Névtelen repeater';
@override
String get holidayGreeting_halloween => 'Boldog Halloweent|Boldog Halloween';
@override
String get holidayGreeting_thanksgiving => 'Boldog hálaadást';
@override
String get holidayGreeting_christmas => 'Boldog karácsonyt';
@override
String get holidayGreeting_newYear => 'Boldog új évet';
}
+245
View File
@@ -828,6 +828,237 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get appSettings_themeDark => 'Scuro';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Lingua';
@@ -6608,4 +6839,18 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get networkMap_unnamed => 'Ripetitore senza nome';
@override
String get holidayGreeting_halloween => 'Buon Halloween|Felice Halloween';
@override
String get holidayGreeting_thanksgiving =>
'Buon Ringraziamento|Buon Thanksgiving';
@override
String get holidayGreeting_christmas => 'Buon Natale';
@override
String get holidayGreeting_newYear =>
'Felice Anno Nuovo|Buon Anno Nuovo|Buon Capodanno';
}
+243
View File
@@ -785,6 +785,237 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get appSettings_themeDark => 'ダーク';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => '言語';
@@ -6293,4 +6524,16 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get networkMap_unnamed => '名前のないリピータ';
@override
String get holidayGreeting_halloween => 'ハッピーハロウィン|ハッピーハロウィーン';
@override
String get holidayGreeting_thanksgiving => 'ハッピーサンクスギビング|感謝祭おめでとう';
@override
String get holidayGreeting_christmas => 'メリークリスマス';
@override
String get holidayGreeting_newYear => 'あけましておめでとう|明けましておめでとう|ハッピーニューイヤー';
}
+243
View File
@@ -787,6 +787,237 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get appSettings_themeDark => '어두움';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => '언어';
@@ -6303,4 +6534,16 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get networkMap_unnamed => '이름 없는 리피터';
@override
String get holidayGreeting_halloween => '해피 할로윈|즐거운 할로윈';
@override
String get holidayGreeting_thanksgiving => '해피 땡스기빙|즐거운 추수감사절|행복한 추수감사절';
@override
String get holidayGreeting_christmas => '메리 크리스마스|즐거운 성탄절';
@override
String get holidayGreeting_newYear => '새해 복 많이 받으세요|새해 복 많이 받아|해피 뉴 이어';
}
+246
View File
@@ -821,6 +821,237 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get appSettings_themeDark => 'Donker';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Taal';
@@ -6562,4 +6793,19 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get networkMap_unnamed => 'Naamloze repeater';
@override
String get holidayGreeting_halloween => 'Fijne Halloween|Gelukkige Halloween';
@override
String get holidayGreeting_thanksgiving =>
'Fijne Thanksgiving|Gelukkige Thanksgiving';
@override
String get holidayGreeting_christmas =>
'Vrolijk kerstfeest|Fijne kerst|Prettige kerstdagen|Zalig kerstfeest';
@override
String get holidayGreeting_newYear =>
'Gelukkig Nieuwjaar|Gelukkig nieuw jaar';
}
+245
View File
@@ -832,6 +832,237 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get appSettings_themeDark => 'Ciemny';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Język';
@@ -6628,4 +6859,18 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get networkMap_unnamed => 'Repeater bez nazwy';
@override
String get holidayGreeting_halloween =>
'Wesołego Halloween|Szczęśliwego Halloween';
@override
String get holidayGreeting_thanksgiving =>
'Szczęśliwego Święta Dziękczynienia|Wesołego Święta Dziękczynienia';
@override
String get holidayGreeting_christmas => 'Wesołych Świąt';
@override
String get holidayGreeting_newYear => 'Szczęśliwego Nowego Roku';
}
+245
View File
@@ -827,6 +827,237 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get appSettings_themeDark => 'Escuro';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Idioma';
@@ -6595,4 +6826,18 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get networkMap_unnamed => 'Repetidor sem nome';
@override
String get holidayGreeting_halloween =>
'Feliz Halloween|Feliz Dia das Bruxas';
@override
String get holidayGreeting_thanksgiving =>
'Feliz Dia de Ação de Graças|Feliz Thanksgiving';
@override
String get holidayGreeting_christmas => 'Feliz Natal|Boas Festas';
@override
String get holidayGreeting_newYear => 'Feliz Ano Novo';
}
+245
View File
@@ -829,6 +829,237 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get appSettings_themeDark => 'Тёмная';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Язык';
@@ -6615,4 +6846,18 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get networkMap_unnamed => 'Репитер без имени';
@override
String get holidayGreeting_halloween =>
'С Хэллоуином|С Хеллоуином|Счастливого Хэллоуина';
@override
String get holidayGreeting_thanksgiving =>
'С Днём благодарения|С Днем благодарения';
@override
String get holidayGreeting_christmas => 'С Рождеством|Счастливого Рождества';
@override
String get holidayGreeting_newYear => 'С Новым годом';
}
+243
View File
@@ -820,6 +820,237 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get appSettings_themeDark => 'Tmavé';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Jazyk';
@@ -6582,4 +6813,16 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get networkMap_unnamed => 'Nepomenovaný opakovač';
@override
String get holidayGreeting_halloween => 'Veselý Halloween|Šťastný Halloween';
@override
String get holidayGreeting_thanksgiving => 'Šťastný Deň vďakyvzdania';
@override
String get holidayGreeting_christmas => 'Veselé Vianoce';
@override
String get holidayGreeting_newYear => 'Šťastný Nový rok';
}
+243
View File
@@ -819,6 +819,237 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get appSettings_themeDark => 'Temno';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Jezik';
@@ -6568,4 +6799,16 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get networkMap_unnamed => 'Repeater brez imena';
@override
String get holidayGreeting_halloween => 'Vesel Halloween|Srečen Halloween';
@override
String get holidayGreeting_thanksgiving => 'Vesel dan zahvalnosti';
@override
String get holidayGreeting_christmas => 'Vesel božič';
@override
String get holidayGreeting_newYear => 'Srečno novo leto';
}
+244
View File
@@ -813,6 +813,237 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get appSettings_themeDark => 'Mörkt';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Språk';
@@ -6542,4 +6773,17 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get networkMap_unnamed => 'Namnlös repeater';
@override
String get holidayGreeting_halloween => 'Glad Halloween';
@override
String get holidayGreeting_thanksgiving =>
'Glad Thanksgiving|Trevlig Thanksgiving';
@override
String get holidayGreeting_christmas => 'God jul';
@override
String get holidayGreeting_newYear => 'Gott nytt år';
}
+245
View File
@@ -822,6 +822,237 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get appSettings_themeDark => 'Темна';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => 'Мова';
@@ -6621,4 +6852,18 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get networkMap_unnamed => 'Ретранслятор без назви';
@override
String get holidayGreeting_halloween =>
'З Гелловіном|З Хелловіном|Щасливого Гелловіну';
@override
String get holidayGreeting_thanksgiving => 'З Днем подяки';
@override
String get holidayGreeting_christmas =>
'З Різдвом|Веселого Різдва|Щасливого Різдва';
@override
String get holidayGreeting_newYear => 'З Новим роком';
}
+243
View File
@@ -773,6 +773,237 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get appSettings_themeDark => '深色';
@override
String get appSettings_colorTheme => 'Color theme';
@override
String get appSettings_holidayAnimations => 'Holiday message animations';
@override
String get appSettings_holidayAnimationsSubtitle =>
'Bats, a turkey, Santa or fireworks when someone sends a holiday greeting';
@override
String get themes_title => 'Themes';
@override
String get themes_default => 'MeshCore';
@override
String get themes_defaultSubtitle =>
'Standard colors, follows the Light / Dark setting';
@override
String get themes_builtIn => 'Built-in';
@override
String get themes_holidays => 'Holidays';
@override
String get themes_holidayAutoSwitch => 'Switch automatically';
@override
String get themes_holidayAutoSwitchSubtitle =>
'Uses each holiday\'s theme from 17 days before until the day itself';
@override
String themes_holidayAutoApplied(String holiday) {
return '$holiday theme is on automatically. Your own theme comes back after the holiday.';
}
@override
String get themes_holidayAutoAppliedTag => 'On automatically';
@override
String get themes_myThemes => 'My themes';
@override
String get themes_myThemesEmpty =>
'Make your own theme by picking a background and an accent color.';
@override
String get themes_create => 'Create theme';
@override
String get themes_import => 'Import theme';
@override
String get themes_importHint => 'Paste a theme code';
@override
String get themes_importInvalid => 'That is not a valid theme code';
@override
String themes_imported(String name) {
return 'Added theme \"$name\"';
}
@override
String get themes_customize => 'Customize a copy';
@override
String get themes_copyCode => 'Copy theme code';
@override
String get themes_codeCopied => 'Theme code copied';
@override
String themes_deleteConfirm(String name) {
return 'Delete theme \"$name\"?';
}
@override
String themes_copyName(String name) {
return '$name copy';
}
@override
String get themes_newTitle => 'New theme';
@override
String get themes_editTitle => 'Edit theme';
@override
String get themes_name => 'Name';
@override
String get themes_nameRequired => 'Give your theme a name';
@override
String get themes_background => 'Background';
@override
String get themes_backgroundHelp => 'A dark background makes a dark theme';
@override
String get themes_accent => 'Accent';
@override
String get themes_accentHelp => 'Buttons, highlights and your chat bubbles';
@override
String get themes_hexColor => 'Hex color';
@override
String get themes_preview => 'Preview';
@override
String get themes_previewIncoming => 'Anyone on the mesh tonight?';
@override
String get themes_previewOutgoing => 'Loud and clear!';
@override
String get themes_previewSwitch => 'Notifications';
@override
String get themes_lowContrast =>
'The accent is hard to see on this background';
@override
String get themes_saveAndUse => 'Save and use';
@override
String get themes_icons => 'Icons';
@override
String get themes_iconsHelp =>
'Tap an icon to swap it for another icon or your own picture';
@override
String get themes_iconChanged => 'Changed';
@override
String get themes_iconSend => 'Send button';
@override
String get themes_iconRepeater => 'Repeaters';
@override
String get themes_iconRoom => 'Rooms';
@override
String get themes_iconSensor => 'Sensors';
@override
String get themes_mapMarkers => 'Map markers';
@override
String get themes_mapMarkersHelp =>
'Swap the markers for nodes and for you on the map';
@override
String get themes_iconUsePicture => 'Use a picture';
@override
String get themes_iconReset => 'Use the default icon';
@override
String get themes_iconPictureFailed => 'Could not use that picture';
@override
String get themes_exportFile => 'Export to file';
@override
String get themes_exportAll => 'Export my themes';
@override
String get themes_importFile => 'Import from file';
@override
String get themes_pasteCode => 'Paste theme code';
@override
String get themes_exportFailed => 'Could not export themes';
@override
String themes_importFileResult(int count) {
return 'Imported $count themes';
}
@override
String get themes_importFileNone => 'No themes found in that file';
@override
String get chatBackground_title => 'Chat background';
@override
String get chatBackground_thisChatOnly => 'Only for this chat';
@override
String chatBackground_themeOverrides(String name) {
return 'Your theme \"$name\" sets the background in every chat. Turn that off in the theme to use this one.';
}
@override
String get chatBackground_none => 'None';
@override
String get chatBackground_picture => 'Picture';
@override
String get chatBackground_choosePicture => 'Choose a picture';
@override
String get chatBackground_pictureFailed => 'Could not use that picture';
@override
String get chatBackground_fade => 'Fade';
@override
String get themes_chatBackground => 'Chat background';
@override
String get themes_chatBackgroundHelp =>
'Shown in chats that do not have their own background';
@override
String get themes_chatBackgroundEverywhere => 'Use in every chat';
@override
String get themes_chatBackgroundEverywhereHelp =>
'Also replaces backgrounds set on individual chats';
@override
String get appSettings_language => '语言';
@@ -6145,4 +6376,16 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get networkMap_unnamed => '未命名转发节点';
@override
String get holidayGreeting_halloween => '万圣节快乐|萬聖節快樂';
@override
String get holidayGreeting_thanksgiving => '感恩节快乐|感恩節快樂';
@override
String get holidayGreeting_christmas => '圣诞快乐|聖誕快樂';
@override
String get holidayGreeting_newYear => '新年快乐|新年快樂';
}
+5 -1
View File
@@ -3356,5 +3356,9 @@
"networkMap_manage": "Beheren",
"networkMap_addedToContacts": "Toegevoegd aan contacten",
"networkMap_addFailed": "Kan niet aan contacten toevoegen",
"networkMap_unnamed": "Naamloze repeater"
"networkMap_unnamed": "Naamloze repeater",
"holidayGreeting_halloween": "Fijne Halloween|Gelukkige Halloween",
"holidayGreeting_thanksgiving": "Fijne Thanksgiving|Gelukkige Thanksgiving",
"holidayGreeting_christmas": "Vrolijk kerstfeest|Fijne kerst|Prettige kerstdagen|Zalig kerstfeest",
"holidayGreeting_newYear": "Gelukkig Nieuwjaar|Gelukkig nieuw jaar"
}
+5 -1
View File
@@ -3488,5 +3488,9 @@
"networkMap_manage": "Zarządzaj",
"networkMap_addedToContacts": "Dodano do kontaktów",
"networkMap_addFailed": "Nie udało się dodać do kontaktów",
"networkMap_unnamed": "Repeater bez nazwy"
"networkMap_unnamed": "Repeater bez nazwy",
"holidayGreeting_halloween": "Wesołego Halloween|Szczęśliwego Halloween",
"holidayGreeting_thanksgiving": "Szczęśliwego Święta Dziękczynienia|Wesołego Święta Dziękczynienia",
"holidayGreeting_christmas": "Wesołych Świąt",
"holidayGreeting_newYear": "Szczęśliwego Nowego Roku"
}
+5 -1
View File
@@ -3455,5 +3455,9 @@
},
"networkMap_sourceLocalHint": "Nós que o seu rádio ouviu",
"networkMap_sourceOnlineHint": "Repetidores do mapa de rede online",
"networkMap_sourceBothHint": "Os nós do seu rádio mais o mapa de rede online"
"networkMap_sourceBothHint": "Os nós do seu rádio mais o mapa de rede online",
"holidayGreeting_halloween": "Feliz Halloween|Feliz Dia das Bruxas",
"holidayGreeting_thanksgiving": "Feliz Dia de Ação de Graças|Feliz Thanksgiving",
"holidayGreeting_christmas": "Feliz Natal|Boas Festas",
"holidayGreeting_newYear": "Feliz Ano Novo"
}
+5 -1
View File
@@ -2752,5 +2752,9 @@
"networkMap_manage": "Управлять",
"networkMap_addedToContacts": "Добавлено в контакты",
"networkMap_addFailed": "Не удалось добавить в контакты",
"networkMap_unnamed": "Репитер без имени"
"networkMap_unnamed": "Репитер без имени",
"holidayGreeting_halloween": "С Хэллоуином|С Хеллоуином|Счастливого Хэллоуина",
"holidayGreeting_thanksgiving": "С Днём благодарения|С Днем благодарения",
"holidayGreeting_christmas": "С Рождеством|Счастливого Рождества",
"holidayGreeting_newYear": "С Новым годом"
}
+5 -1
View File
@@ -3456,5 +3456,9 @@
"networkMap_manage": "Spravovať",
"networkMap_addedToContacts": "Pridané do kontaktov",
"networkMap_addFailed": "Nepodarilo sa pridať do kontaktov",
"networkMap_unnamed": "Nepomenovaný opakovač"
"networkMap_unnamed": "Nepomenovaný opakovač",
"holidayGreeting_halloween": "Veselý Halloween|Šťastný Halloween",
"holidayGreeting_thanksgiving": "Šťastný Deň vďakyvzdania",
"holidayGreeting_christmas": "Veselé Vianoce",
"holidayGreeting_newYear": "Šťastný Nový rok"
}
+5 -1
View File
@@ -3456,5 +3456,9 @@
},
"networkMap_sourceLocalHint": "Vozlišča, ki jih je slišal vaš radio",
"networkMap_sourceOnlineHint": "Ponovitelji z spletnega zemljevida omrežja",
"networkMap_sourceBothHint": "Vozlišča vašega radia in spletni zemljevid omrežja"
"networkMap_sourceBothHint": "Vozlišča vašega radia in spletni zemljevid omrežja",
"holidayGreeting_halloween": "Vesel Halloween|Srečen Halloween",
"holidayGreeting_thanksgiving": "Vesel dan zahvalnosti",
"holidayGreeting_christmas": "Vesel božič",
"holidayGreeting_newYear": "Srečno novo leto"
}
+5 -1
View File
@@ -3450,5 +3450,9 @@
},
"networkMap_sourceLocalHint": "Noder som din radio har hört",
"networkMap_sourceOnlineHint": "Repeatrar från den online-baserade nätverkskartan",
"networkMap_sourceBothHint": "Din radios noder plus den online-baserade nätverkskartan"
"networkMap_sourceBothHint": "Din radios noder plus den online-baserade nätverkskartan",
"holidayGreeting_halloween": "Glad Halloween",
"holidayGreeting_thanksgiving": "Glad Thanksgiving|Trevlig Thanksgiving",
"holidayGreeting_christmas": "God jul",
"holidayGreeting_newYear": "Gott nytt år"
}
+5 -1
View File
@@ -3435,5 +3435,9 @@
"networkMap_manage": "Керувати",
"networkMap_addedToContacts": "Додано до контактів",
"networkMap_addFailed": "Не вдалося додати до контактів",
"networkMap_unnamed": "Ретранслятор без назви"
"networkMap_unnamed": "Ретранслятор без назви",
"holidayGreeting_halloween": "З Гелловіном|З Хелловіном|Щасливого Гелловіну",
"holidayGreeting_thanksgiving": "З Днем подяки",
"holidayGreeting_christmas": "З Різдвом|Веселого Різдва|Щасливого Різдва",
"holidayGreeting_newYear": "З Новим роком"
}
+5 -1
View File
@@ -3460,5 +3460,9 @@
},
"networkMap_sourceLocalHint": "你的无线电听到的节点",
"networkMap_sourceOnlineHint": "来自在线网络地图的中继器",
"networkMap_sourceBothHint": "你的无线电节点加上在线网络地图"
"networkMap_sourceBothHint": "你的无线电节点加上在线网络地图",
"holidayGreeting_halloween": "万圣节快乐|萬聖節快樂",
"holidayGreeting_thanksgiving": "感恩节快乐|感恩節快樂",
"holidayGreeting_christmas": "圣诞快乐|聖誕快樂",
"holidayGreeting_newYear": "新年快乐|新年快樂"
}
+20 -5
View File
@@ -33,6 +33,7 @@ import 'services/map_tile_cache_service.dart';
import 'services/chat_text_scale_service.dart';
import 'services/translation_service.dart';
import 'services/ui_view_state_service.dart';
import 'services/chat_background_service.dart';
import 'services/timeout_prediction_service.dart';
import 'storage/prefs_manager.dart';
import 'theme/mesh_theme.dart';
@@ -83,8 +84,13 @@ void main() async {
// `appSettingsService.settings`, so this cannot stay where it used to be
// (after the constructions) without those two starting out wrong.
await appSettingsService.loadSettings();
// Re-check the automatic holiday theme when the date changes.
appSettingsService.startDateWatch();
// Undo a review-mode session the app was killed in before it could exit.
await endReviewModeSession(appSettingsService);
final chatBackgroundService = ChatBackgroundService(appSettingsService);
// Drop pictures left behind by removed backgrounds or abandoned edits.
unawaited(chatBackgroundService.collectGarbage());
// ---- image messages (AEIC over GRP_DATA) --------------------------------
// The codec owns the ONNX decoder; the store owns received-image state and
@@ -209,6 +215,7 @@ void main() async {
receivedImageStore: receivedImageStore,
imageReassembler: imageReassembler,
networkMapUploadService: networkMapUploadService,
chatBackgroundService: chatBackgroundService,
),
);
}
@@ -354,6 +361,7 @@ class MeshCoreApp extends StatefulWidget {
final ReceivedImageStore receivedImageStore;
final ImageStreamReassembler imageReassembler;
final NetworkMapUploadService networkMapUploadService;
final ChatBackgroundService chatBackgroundService;
const MeshCoreApp({
super.key,
@@ -373,6 +381,7 @@ class MeshCoreApp extends StatefulWidget {
required this.receivedImageStore,
required this.imageReassembler,
required this.networkMapUploadService,
required this.chatBackgroundService,
});
@override
@@ -465,9 +474,11 @@ class _MeshCoreAppState extends State<MeshCoreApp> with WidgetsBindingObserver {
ChangeNotifierProvider.value(value: widget.imageCodecService),
ChangeNotifierProvider.value(value: widget.receivedImageStore),
ChangeNotifierProvider.value(value: widget.networkMapUploadService),
ChangeNotifierProvider.value(value: widget.chatBackgroundService),
],
child: Consumer<AppSettingsService>(
builder: (context, settingsService, child) {
final customTheme = settingsService.activeCustomTheme;
return MaterialApp(
title: 'MeshCore Open',
debugShowCheckedModeBanner: false,
@@ -481,11 +492,15 @@ class _MeshCoreAppState extends State<MeshCoreApp> with WidgetsBindingObserver {
locale: _localeFromSetting(
settingsService.settings.languageOverride,
),
theme: MeshTheme.light(),
darkTheme: MeshTheme.dark(),
themeMode: _themeModeFromSetting(
settingsService.settings.themeMode,
),
theme: customTheme != null
? MeshTheme.fromCustom(customTheme)
: MeshTheme.light(),
darkTheme: customTheme != null
? MeshTheme.fromCustom(customTheme)
: MeshTheme.dark(),
themeMode: customTheme != null
? (customTheme.isDark ? ThemeMode.dark : ThemeMode.light)
: _themeModeFromSetting(settingsService.settings.themeMode),
builder: (context, child) {
// Update notification service with resolved locale
final locale = Localizations.localeOf(context);
+57
View File
@@ -1,3 +1,4 @@
import 'custom_theme.dart';
import 'image_codec_support.dart';
import 'translation_support.dart';
@@ -135,6 +136,25 @@ class AppSettings {
/// different first-hop repeaters also satisfies the channel resend.
final bool channelMinHopsCountRepeaters;
final String themeMode;
/// Themes the user made. Built-in presets live in [CustomTheme.presets].
final List<CustomTheme> customThemes;
/// ID of the active custom or preset theme; null uses the stock theme with
/// [themeMode].
final String? activeThemeId;
/// Play a short animation for holiday greetings ("Happy Halloween", ...).
final bool holidayAnimationsEnabled;
/// Show each holiday's theme automatically in the days before it (see
/// `activeHolidayFor`), without changing [activeThemeId].
final bool holidayAutoSwitch;
/// Occurrence key (`ActiveHoliday.occurrenceKey`) of the holiday whose
/// automatic theme the user overrode by picking a theme themselves. Only
/// that occurrence is skipped; the next holiday switches again.
final String? holidayThemeDismissed;
final String? languageOverride; // null = system default
final bool appDebugLogEnabled;
final Map<String, String> batteryChemistryByDeviceId;
@@ -265,6 +285,11 @@ class AppSettings {
this.channelMinHopsRetries = 1,
this.channelMinHopsCountRepeaters = false,
this.themeMode = 'system',
this.customThemes = const [],
this.activeThemeId,
this.holidayAnimationsEnabled = true,
this.holidayAutoSwitch = true,
this.holidayThemeDismissed,
this.languageOverride,
this.appDebugLogEnabled = false,
Map<String, String>? batteryChemistryByDeviceId,
@@ -356,6 +381,11 @@ class AppSettings {
'channel_min_hops_retries': channelMinHopsRetries,
'channel_min_hops_count_repeaters': channelMinHopsCountRepeaters,
'theme_mode': themeMode,
'custom_themes': customThemes.map((t) => t.toJson()).toList(),
'active_theme_id': activeThemeId,
'holiday_animations_enabled': holidayAnimationsEnabled,
'holiday_auto_switch': holidayAutoSwitch,
'holiday_theme_dismissed': holidayThemeDismissed,
'language_override': languageOverride,
'app_debug_log_enabled': appDebugLogEnabled,
'battery_chemistry_by_device_id': batteryChemistryByDeviceId,
@@ -494,6 +524,18 @@ class AppSettings {
channelMinHopsCountRepeaters:
json['channel_min_hops_count_repeaters'] as bool? ?? false,
themeMode: json['theme_mode'] as String? ?? 'system',
customThemes:
(json['custom_themes'] as List<dynamic>?)
?.whereType<Map>()
.map((e) => CustomTheme.fromJson(Map<String, dynamic>.from(e)))
.where((t) => t.id.isNotEmpty)
.toList() ??
const [],
activeThemeId: json['active_theme_id'] as String?,
holidayAnimationsEnabled:
json['holiday_animations_enabled'] as bool? ?? true,
holidayAutoSwitch: json['holiday_auto_switch'] as bool? ?? true,
holidayThemeDismissed: json['holiday_theme_dismissed'] as String?,
languageOverride: json['language_override'] as String?,
appDebugLogEnabled: json['app_debug_log_enabled'] as bool? ?? false,
batteryChemistryByDeviceId:
@@ -637,6 +679,11 @@ class AppSettings {
int? channelMinHopsRetries,
bool? channelMinHopsCountRepeaters,
String? themeMode,
List<CustomTheme>? customThemes,
Object? activeThemeId = _unset,
bool? holidayAnimationsEnabled,
bool? holidayAutoSwitch,
Object? holidayThemeDismissed = _unset,
Object? languageOverride = _unset,
bool? appDebugLogEnabled,
Map<String, String>? batteryChemistryByDeviceId,
@@ -725,6 +772,16 @@ class AppSettings {
channelMinHopsCountRepeaters:
channelMinHopsCountRepeaters ?? this.channelMinHopsCountRepeaters,
themeMode: themeMode ?? this.themeMode,
customThemes: customThemes ?? this.customThemes,
activeThemeId: activeThemeId == _unset
? this.activeThemeId
: activeThemeId as String?,
holidayAnimationsEnabled:
holidayAnimationsEnabled ?? this.holidayAnimationsEnabled,
holidayAutoSwitch: holidayAutoSwitch ?? this.holidayAutoSwitch,
holidayThemeDismissed: holidayThemeDismissed == _unset
? this.holidayThemeDismissed
: holidayThemeDismissed as String?,
languageOverride: languageOverride == _unset
? this.languageOverride
: languageOverride as String?,
+132
View File
@@ -0,0 +1,132 @@
import 'dart:convert';
import 'dart:ui';
import 'package:flutter/foundation.dart';
import '../theme/theme_icons.dart' show isThemeAssetPath;
import 'custom_theme.dart';
/// Background drawn behind a chat's messages: a color or a picture.
///
/// [fade] blends the theme's normal background over it (0 = full strength,
/// 1 = invisible) so text drawn outside bubbles stays readable.
@immutable
class ChatBackground {
static const double defaultFade = 0.4;
static const double minFade = 0.1;
static const double maxFade = 0.9;
final Color? color;
/// ID of a picture in the chat background image store.
final String? imageId;
/// Picture bytes carried inside a share code or `.jsonl` file, before it
/// has been written to the image store. Never persisted in settings.
final Uint8List? inlineImage;
/// A JPEG XL picture bundled with the app (built-in themes).
final String? asset;
final double fade;
const ChatBackground.color(Color this.color, {this.fade = defaultFade})
: imageId = null,
inlineImage = null,
asset = null;
const ChatBackground.image(String this.imageId, {this.fade = defaultFade})
: color = null,
inlineImage = null,
asset = null;
const ChatBackground.asset(String this.asset, {this.fade = defaultFade})
: color = null,
imageId = null,
inlineImage = null;
const ChatBackground._({
this.color,
this.imageId,
this.inlineImage,
this.asset,
required this.fade,
});
bool get isImage => imageId != null || inlineImage != null || asset != null;
ChatBackground withFade(double value) => ChatBackground._(
color: color,
imageId: imageId,
inlineImage: inlineImage,
asset: asset,
fade: value.clamp(minFade, maxFade).toDouble(),
);
/// A copy whose picture lives in the image store under [id].
ChatBackground withStoredImage(String id) =>
ChatBackground._(imageId: id, fade: fade);
/// A copy carrying the picture bytes for sharing.
ChatBackground withInlineImage(Uint8List bytes) =>
ChatBackground._(imageId: imageId, inlineImage: bytes, fade: fade);
/// Storage form: a color or an image-store ID.
Map<String, dynamic> toJson() => {
if (color != null) 'color': colorToHex(color!),
if (imageId != null) 'image': imageId,
if (asset != null) 'asset': asset,
'fade': fade,
};
/// Sharing form: a color or the picture itself. Null when this is a
/// picture whose bytes were not attached.
Map<String, dynamic>? toShareJson() {
if (color != null) return {'color': colorToHex(color!), 'fade': fade};
// Bundled pictures exist in every install, so the path is enough.
if (asset != null) return {'asset': asset, 'fade': fade};
if (inlineImage != null) {
return {'imageData': base64Encode(inlineImage!), 'fade': fade};
}
return null;
}
static ChatBackground? fromJson(Object? json) {
if (json is! Map) return null;
final rawFade = json['fade'];
final fade = (rawFade is num ? rawFade.toDouble() : defaultFade)
.clamp(minFade, maxFade)
.toDouble();
final color = parseHexColor(json['color']);
if (color != null) return ChatBackground.color(color, fade: fade);
final asset = json['asset'];
if (isThemeAssetPath(asset)) {
return ChatBackground.asset(asset as String, fade: fade);
}
final imageId = json['image'];
if (imageId is String && imageId.isNotEmpty) {
return ChatBackground.image(imageId, fade: fade);
}
final data = json['imageData'];
if (data is String && data.isNotEmpty) {
try {
return ChatBackground._(inlineImage: base64Decode(data), fade: fade);
} on FormatException {
return null;
}
}
return null;
}
@override
bool operator ==(Object other) =>
other is ChatBackground &&
other.color == color &&
other.imageId == imageId &&
other.asset == asset &&
other.fade == fade &&
identical(other.inlineImage, inlineImage);
@override
int get hashCode => Object.hash(color, imageId, asset, fade, inlineImage);
}
+394
View File
@@ -0,0 +1,394 @@
import 'dart:convert';
import 'dart:ui';
import 'package:flutter/foundation.dart';
import '../theme/theme_icons.dart';
import 'chat_background.dart';
/// A user-made theme.
///
/// Kept deliberately small: a theme is a name plus two colors. Everything
/// else (surfaces, text, borders, chat bubbles, light vs dark) is derived
/// from those two, so anyone can make a readable theme in a few taps.
/// Optionally it swaps some app icons for other icons or small pictures.
///
/// The share code is plain JSON, so a theme can also be written by hand:
///
/// ```json
/// {"name": "Forest", "background": "#0E1A13", "accent": "#4ADE80",
/// "icons": {"map": {"icon": "park"}}}
/// ```
class CustomTheme {
static const Object _unset = Object();
/// Prefix for the IDs of the built-in [presets].
static const presetIdPrefix = 'preset:';
final String id;
final String name;
/// Main screen color. Its brightness decides whether the theme is light or
/// dark.
final Color background;
/// Buttons, switches, links, highlights and your own chat bubbles.
final Color accent;
/// Replacement icons keyed by [ThemeIconSlot.key]; empty keeps defaults.
final Map<String, ThemeIconOverride> icons;
/// Background for chats that have none of their own.
final ChatBackground? chatBackground;
/// When true, [chatBackground] also replaces chats' own backgrounds.
final bool chatBackgroundEverywhere;
const CustomTheme({
required this.id,
required this.name,
required this.background,
required this.accent,
this.icons = const {},
this.chatBackground,
this.chatBackgroundEverywhere = false,
});
bool get isPreset => id.startsWith(presetIdPrefix);
/// True when [background] is dark enough to need light text.
bool get isDark => isDarkColor(background);
CustomTheme copyWith({
String? id,
String? name,
Color? background,
Color? accent,
Map<String, ThemeIconOverride>? icons,
Object? chatBackground = _unset,
bool? chatBackgroundEverywhere,
}) {
return CustomTheme(
id: id ?? this.id,
name: name ?? this.name,
background: background ?? this.background,
accent: accent ?? this.accent,
icons: icons ?? this.icons,
chatBackground: identical(chatBackground, _unset)
? this.chatBackground
: chatBackground as ChatBackground?,
chatBackgroundEverywhere:
chatBackgroundEverywhere ?? this.chatBackgroundEverywhere,
);
}
/// Storage form: chat background pictures are referenced by image-store ID.
Map<String, dynamic> toJson() => {
'id': id,
..._contentJson(),
if (chatBackground != null) 'chat_background': chatBackground!.toJson(),
if (chatBackgroundEverywhere) 'chat_background_everywhere': true,
};
Map<String, dynamic> _contentJson() => {
'name': name,
'background': colorToHex(background),
'accent': colorToHex(accent),
if (icons.isNotEmpty)
'icons': icons.map((key, value) => MapEntry(key, value.toJson())),
};
factory CustomTheme.fromJson(Map<String, dynamic> json) {
return CustomTheme(
id: json['id'] as String? ?? '',
name: (json['name'] as String? ?? '').trim(),
background: parseHexColor(json['background']) ?? const Color(0xFF0B1220),
accent: parseHexColor(json['accent']) ?? const Color(0xFF0EA5E9),
icons: parseThemeIcons(json['icons']),
chatBackground: ChatBackground.fromJson(json['chat_background']),
chatBackgroundEverywhere: json['chat_background_everywhere'] == true,
);
}
/// Human-readable JSON for sharing (no ID). Pictures are embedded, so a
/// theme with pictures makes a longer code. A chat background picture is
/// only included once its bytes are attached (see
/// `ChatBackgroundService.embedThemeImages`).
String toShareCode() {
final chat = chatBackground?.toShareJson();
return jsonEncode({
..._contentJson(),
'chatBackground': ?chat,
if (chat != null && chatBackgroundEverywhere)
'chatBackgroundEverywhere': true,
});
}
/// Parses a share code. Returns null when [code] is not a valid theme.
/// The returned theme carries [newId].
static CustomTheme? fromShareCode(String code, {required String newId}) {
try {
final decoded = jsonDecode(code.trim());
if (decoded is! Map) return null;
final name = decoded['name'];
final background = parseHexColor(decoded['background']);
final accent = parseHexColor(decoded['accent']);
if (name is! String || name.trim().isEmpty) return null;
if (background == null || accent == null) return null;
return CustomTheme(
id: newId,
name: name.trim(),
background: background,
accent: accent,
icons: parseThemeIcons(decoded['icons']),
// Only colors and inline pictures: an image-store ID from another
// device would point at nothing here.
chatBackground: _sharedChatBackground(decoded['chatBackground']),
chatBackgroundEverywhere: decoded['chatBackgroundEverywhere'] == true,
);
} on FormatException {
return null;
}
}
@override
bool operator ==(Object other) =>
other is CustomTheme &&
other.id == id &&
other.name == name &&
other.background == background &&
other.accent == accent &&
mapEquals(other.icons, icons) &&
other.chatBackground == chatBackground &&
other.chatBackgroundEverywhere == chatBackgroundEverywhere;
@override
int get hashCode => Object.hash(
id,
name,
background,
accent,
Object.hashAllUnordered(
icons.entries.map((e) => Object.hash(e.key, e.value)),
),
chatBackground,
chatBackgroundEverywhere,
);
static ChatBackground? _sharedChatBackground(Object? json) {
final background = ChatBackground.fromJson(json);
if (background == null || background.imageId != null) return null;
return background;
}
/// Ready-made themes. They also serve as starting points for new ones.
static const List<CustomTheme> presets = [
CustomTheme(
id: '${presetIdPrefix}forest',
name: 'Forest',
background: Color(0xFF0E1A13),
accent: Color(0xFF4ADE80),
),
CustomTheme(
id: '${presetIdPrefix}ocean',
name: 'Ocean',
background: Color(0xFF071A2B),
accent: Color(0xFF22D3EE),
),
CustomTheme(
id: '${presetIdPrefix}ember',
name: 'Ember',
background: Color(0xFF1C1210),
accent: Color(0xFFFB923C),
),
CustomTheme(
id: '${presetIdPrefix}grape',
name: 'Grape',
background: Color(0xFF17112A),
accent: Color(0xFFC084FC),
),
CustomTheme(
id: '${presetIdPrefix}high_contrast',
name: 'High Contrast',
background: Color(0xFF000000),
accent: Color(0xFFFACC15),
),
CustomTheme(
id: '${presetIdPrefix}paper',
name: 'Paper',
background: Color(0xFFFAF7F0),
accent: Color(0xFF9A3412),
),
CustomTheme(
id: '${presetIdPrefix}mint',
name: 'Mint',
background: Color(0xFFEFFAF4),
accent: Color(0xFF047857),
),
CustomTheme(
id: '${presetIdPrefix}sky',
name: 'Sky',
background: Color(0xFFF0F6FC),
accent: Color(0xFF1D4ED8),
),
];
/// Holiday themes: colors, a chat background and festive icons, all
/// bundled under `assets/themes/<holiday>/`.
static const List<CustomTheme> holidayPresets = [
CustomTheme(
id: '${presetIdPrefix}halloween',
name: 'Halloween',
background: Color(0xFF160F22),
accent: Color(0xFFFF7A1A),
icons: _HolidayIcons.halloween,
chatBackground: ChatBackground.asset(
'assets/themes/halloween/background.jxl',
fade: 0.35,
),
),
CustomTheme(
id: '${presetIdPrefix}thanksgiving',
name: 'Thanksgiving',
background: Color(0xFF1C120B),
accent: Color(0xFFF2A93B),
icons: _HolidayIcons.thanksgiving,
chatBackground: ChatBackground.asset(
'assets/themes/thanksgiving/background.jxl',
fade: 0.3,
),
),
CustomTheme(
id: '${presetIdPrefix}christmas',
name: 'Christmas',
background: Color(0xFF0B1F14),
accent: Color(0xFFE5484D),
icons: _HolidayIcons.christmas,
chatBackground: ChatBackground.asset(
'assets/themes/christmas/background.jxl',
fade: 0.35,
),
),
CustomTheme(
id: '${presetIdPrefix}new_year',
name: "New Year's",
background: Color(0xFF0A1024),
accent: Color(0xFFF5C542),
icons: _HolidayIcons.newYear,
chatBackground: ChatBackground.asset(
'assets/themes/new_year/background.jxl',
fade: 0.35,
),
),
];
static CustomTheme? presetById(String id) {
for (final preset in [...presets, ...holidayPresets]) {
if (preset.id == id) return preset;
}
return null;
}
}
/// `#RRGGBB` (alpha dropped — themes are always opaque).
String colorToHex(Color color) {
final rgb = color.toARGB32() & 0xFFFFFF;
return '#${rgb.toRadixString(16).padLeft(6, '0').toUpperCase()}';
}
/// Accepts `#RRGGBB`, `RRGGBB`, `#RGB` or `RGB`. Returns an opaque color, or
/// null when [value] is not a hex color.
Color? parseHexColor(Object? value) {
if (value is! String) return null;
var hex = value.trim();
if (hex.startsWith('#')) hex = hex.substring(1);
if (hex.length == 3) {
hex = hex.split('').map((c) => '$c$c').join();
}
if (hex.length != 6) return null;
final rgb = int.tryParse(hex, radix: 16);
if (rgb == null) return null;
return Color(0xFF000000 | rgb);
}
/// Same threshold Flutter's `ThemeData.estimateBrightnessForColor` uses, so
/// "dark" here agrees with Material's text-color choices.
bool isDarkColor(Color color) {
final luminance = color.computeLuminance();
const kThreshold = 0.15;
return (luminance + 0.05) * (luminance + 0.05) <= kThreshold;
}
/// Icon sets for [CustomTheme.holidayPresets]: the three tabs and Send.
abstract final class _HolidayIcons {
static const halloween = {
'contacts': ThemeIconOverride.asset('assets/themes/halloween/contacts.jxl'),
'channels': ThemeIconOverride.asset('assets/themes/halloween/channels.jxl'),
'map': ThemeIconOverride.asset('assets/themes/halloween/map.jxl'),
'send': ThemeIconOverride.asset('assets/themes/halloween/send.jxl'),
'map_chat': ThemeIconOverride.asset('assets/themes/halloween/map_chat.jxl'),
'map_repeater': ThemeIconOverride.asset(
'assets/themes/halloween/map_repeater.jxl',
),
'map_room': ThemeIconOverride.asset('assets/themes/halloween/map_room.jxl'),
'map_sensor': ThemeIconOverride.asset(
'assets/themes/halloween/map_sensor.jxl',
),
'map_self': ThemeIconOverride.asset('assets/themes/halloween/map_self.jxl'),
};
static const thanksgiving = {
'contacts': ThemeIconOverride.asset(
'assets/themes/thanksgiving/contacts.jxl',
),
'channels': ThemeIconOverride.asset(
'assets/themes/thanksgiving/channels.jxl',
),
'map': ThemeIconOverride.asset('assets/themes/thanksgiving/map.jxl'),
'send': ThemeIconOverride.asset('assets/themes/thanksgiving/send.jxl'),
'map_chat': ThemeIconOverride.asset(
'assets/themes/thanksgiving/map_chat.jxl',
),
'map_repeater': ThemeIconOverride.asset(
'assets/themes/thanksgiving/map_repeater.jxl',
),
'map_room': ThemeIconOverride.asset(
'assets/themes/thanksgiving/map_room.jxl',
),
'map_sensor': ThemeIconOverride.asset(
'assets/themes/thanksgiving/map_sensor.jxl',
),
'map_self': ThemeIconOverride.asset(
'assets/themes/thanksgiving/map_self.jxl',
),
};
static const christmas = {
'contacts': ThemeIconOverride.asset('assets/themes/christmas/contacts.jxl'),
'channels': ThemeIconOverride.asset('assets/themes/christmas/channels.jxl'),
'map': ThemeIconOverride.asset('assets/themes/christmas/map.jxl'),
'send': ThemeIconOverride.asset('assets/themes/christmas/send.jxl'),
'map_chat': ThemeIconOverride.asset('assets/themes/christmas/map_chat.jxl'),
'map_repeater': ThemeIconOverride.asset(
'assets/themes/christmas/map_repeater.jxl',
),
'map_room': ThemeIconOverride.asset('assets/themes/christmas/map_room.jxl'),
'map_sensor': ThemeIconOverride.asset(
'assets/themes/christmas/map_sensor.jxl',
),
'map_self': ThemeIconOverride.asset('assets/themes/christmas/map_self.jxl'),
};
static const newYear = {
'contacts': ThemeIconOverride.asset('assets/themes/new_year/contacts.jxl'),
'channels': ThemeIconOverride.asset('assets/themes/new_year/channels.jxl'),
'map': ThemeIconOverride.asset('assets/themes/new_year/map.jxl'),
'send': ThemeIconOverride.asset('assets/themes/new_year/send.jxl'),
'map_chat': ThemeIconOverride.asset('assets/themes/new_year/map_chat.jxl'),
'map_repeater': ThemeIconOverride.asset(
'assets/themes/new_year/map_repeater.jxl',
),
'map_room': ThemeIconOverride.asset('assets/themes/new_year/map_room.jxl'),
'map_sensor': ThemeIconOverride.asset(
'assets/themes/new_year/map_sensor.jxl',
),
'map_self': ThemeIconOverride.asset('assets/themes/new_year/map_self.jxl'),
};
}
+101
View File
@@ -0,0 +1,101 @@
import 'custom_theme.dart';
/// How many days before a holiday its theme starts being applied
/// automatically. The holiday day itself is distance 0.
const int holidayThemeLeadDays = 17;
/// The holidays that have an automatic theme, in calendar order.
enum ThemeHoliday {
halloween('${CustomTheme.presetIdPrefix}halloween'),
thanksgiving('${CustomTheme.presetIdPrefix}thanksgiving'),
christmas('${CustomTheme.presetIdPrefix}christmas'),
newYear('${CustomTheme.presetIdPrefix}new_year');
const ThemeHoliday(this.themeId);
/// ID of the matching preset in [CustomTheme.holidayPresets].
final String themeId;
/// The holiday's date in [year]: Halloween Oct 31, US Thanksgiving (the
/// fourth Thursday of November), Christmas Dec 25, New Year's Day Jan 1.
DateTime dateIn(int year) {
switch (this) {
case ThemeHoliday.halloween:
return DateTime(year, 10, 31);
case ThemeHoliday.thanksgiving:
final nov1 = DateTime(year, 11, 1);
final toThursday = (DateTime.thursday - nov1.weekday + 7) % 7;
return DateTime(year, 11, 1 + toThursday + 21);
case ThemeHoliday.christmas:
return DateTime(year, 12, 25);
case ThemeHoliday.newYear:
return DateTime(year, 1, 1);
}
}
}
/// One occurrence of a [ThemeHoliday] that is currently within its window.
class ActiveHoliday {
final ThemeHoliday holiday;
/// Local date (midnight) of this occurrence of the holiday.
final DateTime date;
/// Whole days from today until [date]; 0 on the holiday itself.
final int daysAway;
const ActiveHoliday(this.holiday, this.date, this.daysAway);
String get themeId => holiday.themeId;
/// Identifies this occurrence, e.g. `preset:christmas@2026-12-25`, so a
/// dismissal applies to one year's holiday only.
String get occurrenceKey {
String two(int v) => v.toString().padLeft(2, '0');
return '$themeId@${date.year}-${two(date.month)}-${two(date.day)}';
}
@override
bool operator ==(Object other) =>
other is ActiveHoliday &&
other.holiday == holiday &&
other.date == date &&
other.daysAway == daysAway;
@override
int get hashCode => Object.hash(holiday, date, daysAway);
@override
String toString() => 'ActiveHoliday($occurrenceKey, $daysAway days away)';
}
/// The holiday whose theme should be showing on [today] (local date; the
/// time of day is ignored), or null when none is close enough.
///
/// For each holiday the next occurrence on or after today is taken (today
/// counts, and the year wraps, so on Dec 20 New Year's is the coming Jan 1).
/// Holidays 0..[holidayThemeLeadDays] days away are candidates and the
/// nearest one wins. That means a holiday keeps its theme up to and including
/// its own day even if a later holiday's window has opened (Thanksgiving
/// before Christmas, Christmas before New Year's), and the next holiday takes
/// over the day after. Once a holiday has passed and no other is within the
/// window, null is returned and the user's own theme applies again.
ActiveHoliday? activeHolidayFor(DateTime today) {
// Day arithmetic in UTC so daylight-saving shifts never skew the count.
final day = DateTime.utc(today.year, today.month, today.day);
ActiveHoliday? best;
for (final holiday in ThemeHoliday.values) {
var date = holiday.dateIn(today.year);
var target = DateTime.utc(date.year, date.month, date.day);
if (target.isBefore(day)) {
date = holiday.dateIn(today.year + 1);
target = DateTime.utc(date.year, date.month, date.day);
}
final daysAway = target.difference(day).inDays;
if (daysAway > holidayThemeLeadDays) continue;
if (best == null || daysAway < best.daysAway) {
best = ActiveHoliday(holiday, date, daysAway);
}
}
return best;
}
+39 -1
View File
@@ -23,6 +23,7 @@ import '../widgets/sync_progress_overlay.dart';
import '../widgets/translation_settings_section.dart';
import '../helpers/snack_bar_builder.dart';
import 'map_cache_screen.dart';
import 'themes_screen.dart';
class AppSettingsScreen extends StatelessWidget {
/// Scrolls the image-message settings into view once, on first build.
@@ -192,8 +193,15 @@ class AppSettingsScreen extends StatelessWidget {
label: Text(context.l10n.appSettings_themeDark),
),
],
selected: {settingsService.settings.themeMode},
// A custom theme sets its own brightness, so no stock mode
// is selected while one is active; picking a mode returns
// to the stock theme.
emptySelectionAllowed: true,
selected: settingsService.activeCustomTheme == null
? {settingsService.settings.themeMode}
: const <String>{},
onSelectionChanged: (selection) {
if (selection.isEmpty) return;
settingsService.setThemeMode(selection.first);
},
),
@@ -201,6 +209,36 @@ class AppSettingsScreen extends StatelessWidget {
),
),
const Divider(height: 1, indent: 16),
MeshNavTile(
icon: Icons.palette_outlined,
title: context.l10n.appSettings_colorTheme,
subtitle:
settingsService.activeCustomTheme?.name ??
context.l10n.themes_default,
trailing: settingsService.activeCustomTheme == null
? null
: ThemeSwatch(
background: settingsService.activeCustomTheme!.background,
accent: settingsService.activeCustomTheme!.accent,
size: 32,
),
onTap: () => Navigator.of(
context,
).push(MaterialPageRoute(builder: (_) => const ThemesScreen())),
),
const Divider(height: 1, indent: 16),
SwitchListTile(
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 4,
),
secondary: const Icon(Icons.celebration_outlined, size: 24),
title: Text(context.l10n.appSettings_holidayAnimations),
subtitle: Text(context.l10n.appSettings_holidayAnimationsSubtitle),
value: settingsService.settings.holidayAnimationsEnabled,
onChanged: settingsService.setHolidayAnimationsEnabled,
),
const Divider(height: 1, indent: 16),
MeshNavTile(
icon: Icons.language_outlined,
title: context.l10n.appSettings_language,
+169 -130
View File
@@ -66,6 +66,9 @@ import 'map_screen.dart';
import 'region_management_screen.dart';
import '../storage/region_store.dart';
import '../utils/share_origin.dart';
import '../services/chat_background_service.dart';
import '../widgets/chat_background.dart';
import '../widgets/holiday_animations.dart';
class ChannelChatScreen extends StatefulWidget {
final Channel channel;
@@ -82,6 +85,8 @@ class ChannelChatScreen extends StatefulWidget {
}
class _ChannelChatScreenState extends State<ChannelChatScreen> {
final _holidayWatcher = HolidayTriggerWatcher();
final _messageAreaKey = GlobalKey();
final TextEditingController _textController = TextEditingController();
final ChatScrollController _scrollController = ChatScrollController();
final FocusNode _textFieldFocusNode = FocusNode();
@@ -435,6 +440,11 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
onSelected: (value) {
if (value == 'region') {
openRegionSelectDialog(widget.channel);
} else if (value == 'background') {
showChatBackgroundSheet(
context,
ChatBackgroundService.channelKey(widget.channel),
);
} else if (value == 'clearChat') {
_confirmClearChat();
}
@@ -452,6 +462,16 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
],
),
),
PopupMenuItem(
value: 'background',
child: Row(
children: [
const Icon(Icons.wallpaper, size: 20),
const SizedBox(width: 12),
Text(context.l10n.chatBackground_title),
],
),
),
PopupMenuItem(
value: 'clearChat',
child: Row(
@@ -480,130 +500,148 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
child: Column(
children: [
Expanded(
child: Consumer<MeshCoreConnector>(
builder: (context, connector, child) {
final messages = connector.getChannelMessages(widget.channel);
final layout = _transcriptLayoutFor(context, messages);
if (layout.length == 0) {
return EmptyState(
icon: widget.channel.isPublicChannel
? Icons.public
: Icons.tag,
title: context.l10n.chat_noMessages,
subtitle: context.l10n.chat_sendMessageTo(
widget.channel.name.isEmpty
? context.l10n.channels_channelIndex(
widget.channel.index,
)
: widget.channel.name,
child: ChatBackdrop(
key: _messageAreaKey,
chatKey: ChatBackgroundService.channelKey(widget.channel),
child: Consumer<MeshCoreConnector>(
builder: (context, connector, child) {
final messages = connector.getChannelMessages(
widget.channel,
);
final newest = messages.isEmpty ? null : messages.last;
_holidayWatcher.onNewest(
context,
id: newest?.messageId,
texts: [newest?.text, newest?.translatedText],
receivedAt: newest?.receivedAt,
originOf: () => newestMessageOrigin(
_messageAreaKey,
isOutgoing: newest?.isOutgoing ?? false,
),
);
}
final layout = _transcriptLayoutFor(context, messages);
final urlImagesEnabled = connector.isChannelUrlImagesEnabled(
widget.channel.index,
);
final rowCount = layout.length;
final itemCount = rowCount + (_isLoadingOlder ? 1 : 0);
// Auto-scroll to bottom if user is already at bottom
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
if (_channelSkipNextBottomSnap) {
_channelSkipNextBottomSnap = false;
return;
if (layout.length == 0) {
return EmptyState(
icon: widget.channel.isPublicChannel
? Icons.public
: Icons.tag,
title: context.l10n.chat_noMessages,
subtitle: context.l10n.chat_sendMessageTo(
widget.channel.name.isEmpty
? context.l10n.channels_channelIndex(
widget.channel.index,
)
: widget.channel.name,
),
);
}
_scrollController.scrollToBottomIfAtBottom();
});
return Stack(
children: [
ChatZoomWrapper(
child: ListView.builder(
reverse: true, // List grows from bottom up
controller: _scrollController,
padding: const EdgeInsets.all(8),
itemCount: itemCount,
itemBuilder: (context, index) {
// Loading indicator now appears at end (bottom) of reversed list
if (_isLoadingOlder && index == itemCount - 1) {
return const Padding(
padding: EdgeInsets.symmetric(vertical: 16),
child: Center(
child: SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
final urlImagesEnabled = connector
.isChannelUrlImagesEnabled(widget.channel.index);
final rowCount = layout.length;
final itemCount = rowCount + (_isLoadingOlder ? 1 : 0);
// Auto-scroll to bottom if user is already at bottom
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
if (_channelSkipNextBottomSnap) {
_channelSkipNextBottomSnap = false;
return;
}
_scrollController.scrollToBottomIfAtBottom();
});
return Stack(
children: [
ChatZoomWrapper(
child: ListView.builder(
reverse: true, // List grows from bottom up
controller: _scrollController,
padding: const EdgeInsets.all(8),
itemCount: itemCount,
itemBuilder: (context, index) {
// Loading indicator now appears at end (bottom) of reversed list
if (_isLoadingOlder && index == itemCount - 1) {
return const Padding(
padding: EdgeInsets.symmetric(vertical: 16),
child: Center(
child: SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
),
),
),
);
}
final row = layout.rowAt(index, messages);
final GlobalKey messageKey;
if (layout.keyedIndices.contains(index)) {
messageKey = _messageKeys.putIfAbsent(
row.id,
GlobalKey.new,
);
} else {
messageKey = GlobalKey();
}
final isUnreadAnchor =
_unreadDividerMessageId != null &&
row.id == _unreadDividerMessageId;
return Container(
key: messageKey,
child: Builder(
builder: (context) {
final textScale = context
.select<ChatTextScaleService, double>(
(service) => service.scale,
);
final message = row.message;
final bubble = message != null
? _buildMessageBubble(
message,
textScale,
urlImagesEnabled,
)
: _buildImageBubble(
row.image!,
textScale,
);
final startsDay =
index == rowCount - 1 ||
!isSameChatDay(
layout
.rowAt(index + 1, messages)
.receivedAt,
row.receivedAt,
);
if (isUnreadAnchor || startsDay) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (startsDay)
ChatDaySeparator(
day: row.receivedAt,
),
if (isUnreadAnchor)
const UnreadDivider(),
bubble,
],
);
}
return bubble;
},
),
);
}
final row = layout.rowAt(index, messages);
final GlobalKey messageKey;
if (layout.keyedIndices.contains(index)) {
messageKey = _messageKeys.putIfAbsent(
row.id,
GlobalKey.new,
);
} else {
messageKey = GlobalKey();
}
final isUnreadAnchor =
_unreadDividerMessageId != null &&
row.id == _unreadDividerMessageId;
return Container(
key: messageKey,
child: Builder(
builder: (context) {
final textScale = context
.select<ChatTextScaleService, double>(
(service) => service.scale,
);
final message = row.message;
final bubble = message != null
? _buildMessageBubble(
message,
textScale,
urlImagesEnabled,
)
: _buildImageBubble(
row.image!,
textScale,
);
final startsDay =
index == rowCount - 1 ||
!isSameChatDay(
layout
.rowAt(index + 1, messages)
.receivedAt,
row.receivedAt,
);
if (isUnreadAnchor || startsDay) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (startsDay)
ChatDaySeparator(day: row.receivedAt),
if (isUnreadAnchor)
const UnreadDivider(),
bubble,
],
);
}
return bubble;
},
),
);
},
},
),
),
),
JumpToBottomButton(scrollController: _scrollController),
],
);
},
JumpToBottomButton(scrollController: _scrollController),
],
);
},
),
),
),
_buildInputBar(),
@@ -660,7 +698,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
message.pathLength,
);
final colors = MessageBubbleColors.of(scheme, isOutgoing: isOutgoing);
final colors = MessageBubbleColors.of(context, isOutgoing: isOutgoing);
final textColor = colors.text;
final metaColor = colors.meta;
const bodyFontSize = 14.0;
@@ -1224,7 +1262,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
Widget? trailing,
}) {
final scheme = Theme.of(context).colorScheme;
final textColor = isOutgoing ? MeshPalette.meInk : scheme.onSurface;
final bubble = MeshBubbleTheme.of(context);
final textColor = isOutgoing ? bubble.meInk : scheme.onSurface;
final metaColor = textColor.withValues(alpha: 0.7);
return Row(
@@ -1691,7 +1730,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
Widget _buildImageBubble(ReceivedImageEntry entry, double textScale) {
final scheme = Theme.of(context).colorScheme;
final isOutgoing = entry.isOutgoing;
final textColor = isOutgoing ? MeshPalette.meInk : scheme.onSurface;
final bubbleTheme = MeshBubbleTheme.of(context);
final textColor = isOutgoing ? bubbleTheme.meInk : scheme.onSurface;
final metaColor = textColor.withValues(alpha: 0.65);
final bubble = Padding(
@@ -1710,11 +1750,11 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
child: Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: isOutgoing ? MeshPalette.me : scheme.surfaceContainerLow,
color: isOutgoing ? bubbleTheme.me : scheme.surfaceContainerLow,
borderRadius: BorderRadius.circular(MeshRadii.lg),
border: Border.all(
color: isOutgoing
? MeshPalette.meBorder
? bubbleTheme.meBorder
: scheme.outlineVariant,
width: 1,
),
@@ -2490,16 +2530,12 @@ class _RegionSelectDialogState extends State<_RegionSelectDialog> {
final selected = connector.isChannelExplicitlyUnscoped(
widget.channel.index,
);
final primary = Theme.of(context).colorScheme.primary;
return ListTile(
leading: Icon(
Icons.public_off,
color: selected ? MeshPalette.blue : null,
),
leading: Icon(Icons.public_off, color: selected ? primary : null),
title: Text(context.l10n.settings_regionNoRegion),
trailing: selected
? const Icon(Icons.check, color: MeshPalette.blue)
: null,
tileColor: selected ? MeshPalette.blueBg : null,
trailing: selected ? Icon(Icons.check, color: primary) : null,
tileColor: selected ? primary.withValues(alpha: 0.16) : null,
onTap: () {
// Tapping the already-selected option clears it back to the default.
connector.setChannelRegion(
@@ -2565,16 +2601,19 @@ class _RegionSelectDialogState extends State<_RegionSelectDialog> {
itemCount: regions.length,
itemBuilder: (context, index) {
final selected = selectedIndex == index;
final primary = Theme.of(context).colorScheme.primary;
return ListTile(
leading: Icon(
Icons.landscape,
color: selected ? MeshPalette.blue : null,
color: selected ? primary : null,
),
title: Text(regions[index]),
trailing: selected
? const Icon(Icons.check, color: MeshPalette.blue)
? Icon(Icons.check, color: primary)
: null,
tileColor: selected
? primary.withValues(alpha: 0.16)
: null,
tileColor: selected ? MeshPalette.blueBg : null,
onTap: () {
// Tapping the already-selected region clears it.
context.read<MeshCoreConnector>().setChannelRegion(
+8 -5
View File
@@ -38,6 +38,7 @@ import 'contacts_screen.dart';
import 'map_screen.dart';
import 'settings_screen.dart';
import '../review_mode/review_mode_banner.dart';
import '../theme/theme_icons.dart';
class ChannelsScreen extends StatefulWidget {
final bool hideBackButton;
@@ -149,7 +150,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
PopupMenuItem(
child: Row(
children: [
const Icon(Icons.settings),
const ThemedIcon(ThemeIconSlot.settings),
const SizedBox(width: 8),
Text(menuContext.l10n.settings_title),
],
@@ -857,9 +858,11 @@ class _ChannelsScreenState extends State<ChannelsScreen>
vertical: 10,
),
borderColor: isSelected && enabled
? MeshPalette.blueLine
? cardScheme.primary.withValues(alpha: 0.5)
: null,
color: isSelected && enabled
? cardScheme.primary.withValues(alpha: 0.16)
: null,
color: isSelected && enabled ? MeshPalette.blueBg : null,
onTap: enabled
? () {
setSheetState(() {
@@ -877,7 +880,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
size: 38,
color: enabled
? (isSelected
? MeshPalette.blue
? cardScheme.primary
: cardScheme.onSurfaceVariant)
: cardScheme.outline,
icon: icon,
@@ -915,7 +918,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
Icon(
Icons.chevron_right,
color: isSelected
? MeshPalette.blue
? cardScheme.primary
: cardScheme.onSurfaceVariant,
size: 20,
),
+43 -8
View File
@@ -52,6 +52,9 @@ import '../theme/mesh_theme.dart';
import '../widgets/future_timestamp_indicator.dart';
import '../widgets/mesh_ui.dart';
import 'telemetry_screen.dart';
import '../services/chat_background_service.dart';
import '../widgets/chat_background.dart';
import '../widgets/holiday_animations.dart';
// Image messages are deliberately absent from this screen, and there is no
// flag to flip: the AEIC wire format is `CMD_SEND_CHANNEL_DATA` (62) /
@@ -76,6 +79,8 @@ class ChatScreen extends StatefulWidget {
}
class _ChatScreenState extends State<ChatScreen> {
final _holidayWatcher = HolidayTriggerWatcher();
final _messageAreaKey = GlobalKey();
final _textController = TextEditingController();
final _scrollController = ChatScrollController();
final _textFieldFocusNode = FocusNode();
@@ -271,6 +276,11 @@ class _ChatScreenState extends State<ChatScreen> {
_showContactInfo(context);
case 'settings':
_showContactSettings(context);
case 'background':
showChatBackgroundSheet(
context,
ChatBackgroundService.contactKey(contact),
);
case 'telemetry':
Navigator.push(
context,
@@ -324,6 +334,16 @@ class _ChatScreenState extends State<ChatScreen> {
],
),
),
PopupMenuItem(
value: 'background',
child: Row(
children: [
const Icon(Icons.wallpaper, size: 20),
const SizedBox(width: 12),
Text(context.l10n.chatBackground_title),
],
),
),
PopupMenuItem(
value: 'clearChat',
child: Row(
@@ -352,16 +372,31 @@ class _ChatScreenState extends State<ChatScreen> {
body: Consumer<MeshCoreConnector>(
builder: (context, connector, child) {
final messages = connector.getMessages(widget.contact);
final newest = messages.isEmpty ? null : messages.last;
_holidayWatcher.onNewest(
context,
id: newest?.messageId,
texts: [newest?.text, newest?.translatedText],
receivedAt: newest?.receivedAt,
originOf: () => newestMessageOrigin(
_messageAreaKey,
isOutgoing: newest?.isOutgoing ?? false,
),
);
return Column(
children: [
Expanded(
child: Stack(
children: [
messages.isEmpty
? _buildEmptyState()
: _buildMessageList(messages, connector),
JumpToBottomButton(scrollController: _scrollController),
],
child: ChatBackdrop(
key: _messageAreaKey,
chatKey: ChatBackgroundService.contactKey(widget.contact),
child: Stack(
children: [
messages.isEmpty
? _buildEmptyState()
: _buildMessageList(messages, connector),
JumpToBottomButton(scrollController: _scrollController),
],
),
),
),
_buildInputBar(connector),
@@ -1269,7 +1304,7 @@ class _MessageBubble extends StatelessWidget {
final publicIpfsGateway = settingsService.settings.publicIpfsGateway;
final colors = MessageBubbleColors.of(
scheme,
context,
isOutgoing: isOutgoing,
isFailed: isFailed,
);
+4 -3
View File
@@ -42,6 +42,7 @@ import 'map_screen.dart';
import '../review_mode/review_mode_banner.dart';
import 'repeater_hub_screen.dart';
import 'settings_screen.dart';
import '../theme/theme_icons.dart';
enum RoomLoginDestination { chat, management }
@@ -500,7 +501,7 @@ class _ContactsScreenState extends State<ContactsScreen>
PopupMenuItem(
child: Row(
children: [
const Icon(Icons.settings),
const ThemedIcon(ThemeIconSlot.settings),
const SizedBox(width: 8),
Text(context.l10n.settings_title),
],
@@ -1886,7 +1887,7 @@ class _ContactTile extends StatelessWidget {
name: contact.name,
size: 42,
color: isChat ? null : contactTypeColor(contact.type),
icon: contactTypeIcon(contact.type),
iconSlot: contactTypeIconSlot(contact.type),
),
const SizedBox(width: 12),
// Main content. The name owns the whole first row (wrapping to
@@ -1978,7 +1979,7 @@ class _ContactTile extends StatelessWidget {
style: MeshTheme.mono(
fontSize: 12.5,
color: unreadCount > 0
? MeshPalette.blue
? scheme.primary
: scheme.onSurfaceVariant,
),
),
+1 -1
View File
@@ -195,7 +195,7 @@ class _DiscoveryScreenState extends State<DiscoveryScreen> {
name: contact.name,
size: 42,
color: isChat ? null : contactTypeColor(contact.type),
icon: contactTypeIcon(contact.type),
iconSlot: contactTypeIconSlot(contact.type),
),
const SizedBox(width: 12),
Expanded(
+186 -77
View File
@@ -51,6 +51,7 @@ import '../helpers/snack_bar_builder.dart';
import '../helpers/utf8_length_limiter.dart';
import 'settings_screen.dart';
import 'line_of_sight_map_screen.dart';
import '../theme/theme_icons.dart';
class MapScreen extends StatefulWidget {
final LatLng? highlightPosition;
@@ -176,24 +177,30 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
bool get _useDarkOverlay => Theme.of(context).brightness == Brightness.dark;
Color get _overlayPanelColor => _useDarkOverlay
/// The stock dark theme keeps the map's fixed high-contrast panels; custom
/// themes (and light mode) draw panels in the theme's own colors.
bool get _usePaletteOverlay =>
_useDarkOverlay && !MeshMapTheme.of(context).followsTheme;
Color get _overlayPanelColor => _usePaletteOverlay
? MapPalette.panelDark
: _overlayScheme.surfaceContainerLow.withValues(alpha: 0.96);
Color get _overlayPrimaryTextColor =>
_useDarkOverlay ? MapPalette.textPrimary : _overlayScheme.onSurface;
_usePaletteOverlay ? MapPalette.textPrimary : _overlayScheme.onSurface;
Color get _overlaySecondaryTextColor => _useDarkOverlay
Color get _overlaySecondaryTextColor => _usePaletteOverlay
? MapPalette.textSecondary
: _overlayScheme.onSurfaceVariant;
Color get _overlayMutedTextColor =>
_useDarkOverlay ? MapPalette.textMuted : _overlayScheme.onSurfaceVariant;
Color get _overlayMutedTextColor => _usePaletteOverlay
? MapPalette.textMuted
: _overlayScheme.onSurfaceVariant;
Color get _overlayBorderColor =>
_useDarkOverlay ? MapPalette.border : _overlayScheme.outlineVariant;
_usePaletteOverlay ? MapPalette.border : _overlayScheme.outlineVariant;
Color get _overlayShadowColor => _useDarkOverlay
Color get _overlayShadowColor => _usePaletteOverlay
? MapPalette.markerShadow
: MapPalette.markerShadow.withValues(alpha: 0.18);
@@ -450,7 +457,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
),
if (hasSelf)
IconButton(
color: MapPalette.selected,
color: MeshMapTheme.of(context).accent,
icon: const Icon(Icons.my_location),
tooltip: context.l10n.map_centerOnMe,
onPressed: () => _mapController.move(
@@ -636,7 +643,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
Polyline(
points: _points,
strokeWidth: 4,
color: MapPalette.selected,
color: MeshMapTheme.of(context).accent,
),
]
: <Polyline>[],
@@ -783,7 +790,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
connector.selfLatitude!,
connector.selfLongitude!,
),
color: MapPalette.selected,
color: MeshMapTheme.of(context).accent,
icon: Icons.person_pin_circle,
),
);
@@ -825,7 +832,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
PopupMenuItem(
child: Row(
children: [
const Icon(Icons.settings),
const ThemedIcon(ThemeIconSlot.settings),
const SizedBox(width: 8),
Text(context.l10n.settings_title),
],
@@ -1082,7 +1089,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
_handleQuickSwitch(index, context),
contactsUnreadCount: connector.getTotalContactsUnreadCount(),
channelsUnreadCount: connector.getTotalChannelsUnreadCount(),
highContrast: _useDarkOverlay,
highContrast: _usePaletteOverlay,
),
),
floatingActionButton:
@@ -1591,6 +1598,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
: _buildNodeMarkerWidget(
color: baseColor,
icon: mapNodeTypeIcon(contact.type),
slot: mapMarkerSlotForNodeType(contact.type),
selected: selected,
stale: stale,
online: online,
@@ -1734,6 +1742,14 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
);
}
/// A node type's icon as the theme shows it on the map.
Widget _nodeTypeIcon(int type, {required double size, Color? color}) {
final slot = mapMarkerSlotForNodeType(type);
return slot == null
? Icon(mapNodeTypeIcon(type), size: size, color: color)
: ThemedIcon(slot, size: size, color: color);
}
Color _markerColor(Contact contact) {
switch (contact.type) {
case advTypeRepeater:
@@ -1760,9 +1776,52 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
return estimateBatteryPercentFromMillivolts(millivolts, chemistry) <= 20;
}
/// A theme's picture drawn as a whole round marker, with the usual
/// shadow and the accent ring when selected.
Widget _pictureMarker(
ImageProvider picture, {
required double size,
required bool selected,
required IconData fallback,
}) {
final accent = MeshMapTheme.of(context).accent;
return Container(
width: size,
height: size,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: selected ? Border.all(color: accent, width: 3) : null,
boxShadow: [
const BoxShadow(
color: MapPalette.markerShadow,
blurRadius: 8,
offset: Offset(0, 3),
),
if (selected)
BoxShadow(
color: accent.withValues(alpha: 0.75),
blurRadius: 14,
spreadRadius: 3,
),
],
),
child: ClipOval(
child: Image(
image: picture,
fit: BoxFit.cover,
gaplessPlayback: true,
filterQuality: FilterQuality.medium,
errorBuilder: (_, _, _) =>
Icon(fallback, color: accent, size: size * 0.55),
),
),
);
}
Widget _buildNodeMarkerWidget({
required Color color,
required IconData icon,
ThemeIconSlot? slot,
bool selected = false,
bool stale = false,
bool online = false,
@@ -1775,41 +1834,57 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
: stale
? MapPalette.offline
: MapPalette.stale;
final override = slot == null ? null : MeshIconTheme.of(context)[slot];
final picture = themePictureOf(override);
final namedIcon = override?.icon == null
? null
: kThemeIconCatalog[override!.icon];
return Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
Container(
width: selected ? 44 : 36,
height: selected ? 44 : 36,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: selected ? MapPalette.selected : color,
border: Border.all(
color: MapPalette.markerOutline,
width: selected ? 3 : 2.5,
),
boxShadow: [
const BoxShadow(
color: MapPalette.markerShadow,
blurRadius: 8,
offset: Offset(0, 3),
if (picture != null)
// Pictures carry more detail than a glyph, so they get more room.
_pictureMarker(
picture,
size: selected ? 50 : 42,
selected: selected,
fallback: icon,
)
else
Container(
width: selected ? 44 : 36,
height: selected ? 44 : 36,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: selected ? MeshMapTheme.of(context).accent : color,
border: Border.all(
color: MapPalette.markerOutline,
width: selected ? 3 : 2.5,
),
if (selected)
BoxShadow(
color: MapPalette.selected.withValues(alpha: 0.75),
blurRadius: 14,
spreadRadius: 3,
boxShadow: [
const BoxShadow(
color: MapPalette.markerShadow,
blurRadius: 8,
offset: Offset(0, 3),
),
],
if (selected)
BoxShadow(
color: MeshMapTheme.of(
context,
).accent.withValues(alpha: 0.75),
blurRadius: 14,
spreadRadius: 3,
),
],
),
alignment: Alignment.center,
child: Icon(
namedIcon ?? icon,
color: MapPalette.markerOutline,
size: selected ? 22 : 19,
),
),
alignment: Alignment.center,
child: Icon(
icon,
color: MapPalette.markerOutline,
size: selected ? 22 : 19,
),
),
Positioned(
right: selected ? -1 : -2,
bottom: selected ? 0 : -2,
@@ -1835,13 +1910,21 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
);
}
Widget _buildLegendItem(IconData icon, String label, Color color) {
Widget _buildLegendItem(
IconData icon,
String label,
Color color, {
ThemeIconSlot? slot,
}) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 1.5),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, size: 18, color: color),
if (slot != null)
ThemedIcon(slot, size: 18, color: color)
else
Icon(icon, size: 18, color: color),
const SizedBox(width: 8),
Expanded(
child: Text(
@@ -1952,7 +2035,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
color: _overlayPrimaryTextColor,
fontWeight: FontWeight.w600,
),
cursorColor: MapPalette.selected,
cursorColor: MeshMapTheme.of(context).accent,
onChanged: (value) {
setState(() => _searchQuery = value);
},
@@ -1974,10 +2057,10 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(
Icon(
Icons.hub,
size: 18,
color: MapPalette.selected,
color: MeshMapTheme.of(context).accent,
),
const SizedBox(width: 6),
Text(
@@ -2049,7 +2132,9 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
side: BorderSide.none,
foregroundColor: _overlaySecondaryTextColor,
selectedForegroundColor: _overlayPrimaryTextColor,
selectedBackgroundColor: MapPalette.selected.withValues(alpha: 0.34),
selectedBackgroundColor: MeshMapTheme.of(
context,
).accent.withValues(alpha: 0.34),
textStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w700),
),
segments: [
@@ -2168,7 +2253,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
),
child: Row(
children: [
Icon(mapNodeTypeIcon(c.type), size: 18, color: color),
_nodeTypeIcon(c.type, size: 18, color: color),
const SizedBox(width: 10),
Expanded(
child: Column(
@@ -2278,7 +2363,11 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
_statRow(context.l10n.map_visible, visibleCount, MapPalette.selected),
_statRow(
context.l10n.map_visible,
visibleCount,
MeshMapTheme.of(context).accent,
),
_statRow(context.l10n.map_online, onlineCount, MapPalette.online),
_statRow(
context.l10n.map_repeaters,
@@ -2291,22 +2380,26 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
_buildLegendItem(
Icons.person,
context.l10n.map_chat,
MapPalette.selected,
MeshMapTheme.of(context).accent,
slot: ThemeIconSlot.mapChat,
),
_buildLegendItem(
Icons.router,
context.l10n.map_repeater,
MapPalette.repeater,
slot: ThemeIconSlot.mapRepeater,
),
_buildLegendItem(
Icons.meeting_room,
context.l10n.map_room,
MapPalette.router,
slot: ThemeIconSlot.mapRoom,
),
_buildLegendItem(
Icons.sensors,
context.l10n.map_sensor,
MapPalette.sensor,
slot: ThemeIconSlot.mapSensor,
),
_buildLegendItem(
Icons.flag,
@@ -2393,6 +2486,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
size: 38,
color: color,
icon: mapNodeTypeIcon(contact.type),
iconSlot: mapMarkerSlotForNodeType(contact.type),
),
const SizedBox(width: 10),
Expanded(
@@ -2525,7 +2619,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
),
TextButton(
style: TextButton.styleFrom(
foregroundColor: MapPalette.selected,
foregroundColor: MeshMapTheme.of(context).accent,
),
onPressed: () => showNodeInfoSheet(
context,
@@ -2819,35 +2913,50 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
}
Marker _buildSelfMarker(LatLng position) {
final override = MeshIconTheme.of(context)[ThemeIconSlot.mapSelf];
final picture = themePictureOf(override);
final namedIcon = override?.icon == null
? null
: kThemeIconCatalog[override!.icon];
return Marker(
point: position,
width: 40,
height: 40,
width: picture != null ? 48 : 40,
height: picture != null ? 48 : 40,
child: IgnorePointer(
child: Semantics(
label: context.l10n.pathTrace_you,
child: Container(
width: 36,
height: 36,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: MapPalette.panelDark,
border: Border.all(color: MapPalette.markerOutline, width: 2.5),
boxShadow: const [
BoxShadow(
color: MapPalette.markerShadow,
blurRadius: 8,
offset: Offset(0, 2),
child: picture != null
? _pictureMarker(
picture,
size: 46,
selected: false,
fallback: Icons.person_pin_circle,
)
: Container(
width: 36,
height: 36,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: MapPalette.panelDark,
border: Border.all(
color: MapPalette.markerOutline,
width: 2.5,
),
boxShadow: const [
BoxShadow(
color: MapPalette.markerShadow,
blurRadius: 8,
offset: Offset(0, 2),
),
],
),
alignment: Alignment.center,
child: Icon(
namedIcon ?? Icons.person_pin_circle,
color: MeshMapTheme.of(context).accent,
size: 22,
),
),
],
),
alignment: Alignment.center,
child: const Icon(
Icons.person_pin_circle,
color: MapPalette.selected,
size: 22,
),
),
),
),
);
@@ -2959,9 +3068,9 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
children: [
if (selfPosition != null)
ListTile(
leading: const Icon(
leading: Icon(
Icons.person_pin_circle,
color: MapPalette.selected,
color: MeshMapTheme.of(context).accent,
),
title: Text(l10n.pathTrace_you),
subtitle: Text(
@@ -3467,7 +3576,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
Widget freshnessChip(_Freshness value, String label) {
final selected = _freshness == value;
final accent = switch (value) {
_Freshness.all => MapPalette.selected,
_Freshness.all => MeshMapTheme.of(context).accent,
_Freshness.online => MapPalette.online,
_Freshness.recent => MapPalette.stale,
_Freshness.stale => MapPalette.offline,
@@ -3940,7 +4049,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
style: MeshTheme.mono(
fontSize: 18,
fontWeight: FontWeight.w700,
color: MapPalette.selected,
color: MeshMapTheme.of(context).accent,
),
),
Text(
+1 -3
View File
@@ -127,9 +127,7 @@ class RepeaterHubScreen extends StatelessWidget {
label: isAdmin
? l10n.repeater_roleAdmin
: l10n.repeater_roleGuest,
color: isAdmin
? MeshPalette.blue
: scheme.onSurfaceVariant,
color: isAdmin ? scheme.primary : scheme.onSurfaceVariant,
),
],
),
+1 -1
View File
@@ -246,7 +246,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
? l10n.common_connected
: l10n.common_disconnected,
color: connector.isConnected
? MeshPalette.blue
? scheme.primary
: scheme.onSurfaceVariant,
pulse: connector.isConnected,
),
+784
View File
@@ -0,0 +1,784 @@
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:provider/provider.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../models/custom_theme.dart';
import '../services/app_settings_service.dart';
import '../theme/mesh_theme.dart';
import '../theme/theme_icons.dart';
import '../models/chat_background.dart';
import '../widgets/adaptive_app_bar_title.dart';
import '../widgets/chat_background.dart';
import '../widgets/message_bubble_frame.dart';
import '../widgets/mesh_ui.dart';
/// Background choices offered as one-tap swatches: dark first, then light.
const List<Color> kThemeBackgroundSwatches = [
Color(0xFF0B1220),
Color(0xFF000000),
Color(0xFF161616),
Color(0xFF0E1A13),
Color(0xFF071A2B),
Color(0xFF1C1210),
Color(0xFF17112A),
Color(0xFF2A1520),
Color(0xFFFFFFFF),
Color(0xFFF4F6F8),
Color(0xFFFAF7F0),
Color(0xFFEFFAF4),
Color(0xFFF0F6FC),
Color(0xFFFBF0F5),
Color(0xFFF5F3FF),
Color(0xFFFFF8E1),
];
/// Accent choices offered as one-tap swatches.
const List<Color> kThemeAccentSwatches = [
Color(0xFF0EA5E9),
Color(0xFF3B82F6),
Color(0xFF1D4ED8),
Color(0xFF6366F1),
Color(0xFFA855F7),
Color(0xFFEC4899),
Color(0xFFEF4444),
Color(0xFF9A3412),
Color(0xFFF97316),
Color(0xFFF59E0B),
Color(0xFFFACC15),
Color(0xFF84CC16),
Color(0xFF22C55E),
Color(0xFF047857),
Color(0xFF14B8A6),
Color(0xFF06B6D4),
];
/// Creates or edits a [CustomTheme]: a name, a background and an accent,
/// with a live preview of the result.
class ThemeEditorScreen extends StatefulWidget {
/// The saved theme being edited; null creates a new one.
final CustomTheme? existing;
/// Colors to start a new theme from (e.g. a preset being customized).
final CustomTheme? startFrom;
final String? initialName;
const ThemeEditorScreen({
super.key,
this.existing,
this.startFrom,
this.initialName,
});
@override
State<ThemeEditorScreen> createState() => _ThemeEditorScreenState();
}
class _ThemeEditorScreenState extends State<ThemeEditorScreen> {
late final TextEditingController _nameController;
final _nameFocus = FocusNode();
final _scrollController = ScrollController();
late Color _background;
late Color _accent;
late Map<String, ThemeIconOverride> _icons;
ChatBackground? _chatBackground;
bool _chatBackgroundEverywhere = false;
bool _showNameError = false;
@override
void initState() {
super.initState();
final source = widget.existing ?? widget.startFrom;
_background = source?.background ?? kThemeBackgroundSwatches.first;
_accent = source?.accent ?? kThemeAccentSwatches.first;
_icons = Map.of(source?.icons ?? const {});
_chatBackground = source?.chatBackground;
_chatBackgroundEverywhere = source?.chatBackgroundEverywhere ?? false;
_nameController = TextEditingController(
text: widget.existing?.name ?? widget.initialName ?? '',
);
}
@override
void dispose() {
_nameController.dispose();
_nameFocus.dispose();
_scrollController.dispose();
super.dispose();
}
CustomTheme get _draft => CustomTheme(
id: widget.existing?.id ?? '',
name: _nameController.text.trim(),
background: _background,
accent: _accent,
icons: Map.unmodifiable(_icons),
chatBackground: _chatBackground,
chatBackgroundEverywhere: _chatBackgroundEverywhere,
);
Widget _iconTile(ThemeIconSlot slot) {
return ListTile(
leading: SizedBox.square(
dimension: 48,
child: Center(
// Shows the shared icon when only the partner slot (list avatar
// or map marker for the same node type) is set, as the app does.
child: ThemedIcon.preview(
slot,
_icons[slot.key] ?? _icons[slot.partner?.key],
size: 28,
),
),
),
title: Text(
themeIconSlotLabel(context, slot),
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: _icons.containsKey(slot.key)
? Text(context.l10n.themes_iconChanged)
: null,
trailing: const Icon(Icons.edit_outlined),
onTap: () => _pickIcon(slot),
);
}
Future<void> _pickIcon(ThemeIconSlot slot) async {
final choice = await showModalBottomSheet<_IconChoice>(
context: context,
isScrollControlled: true,
showDragHandle: true,
builder: (_) => _IconPickerSheet(
slot: slot,
current: _icons[slot.key],
label: themeIconSlotLabel(context, slot),
),
);
if (choice == null || !mounted) return;
if (choice.pickPicture) {
await _pickPicture(slot);
return;
}
setState(() {
final value = choice.value;
if (value == null) {
_icons.remove(slot.key);
} else {
_icons[slot.key] = value;
}
});
}
Future<void> _pickPicture(ThemeIconSlot slot) async {
final XFile? file;
try {
file = await ImagePicker().pickImage(source: ImageSource.gallery);
} catch (_) {
if (mounted) _showPictureError();
return;
}
if (file == null) return;
final shrunk = await shrinkThemeIconImage(await file.readAsBytes());
if (!mounted) return;
if (shrunk == null) {
_showPictureError();
return;
}
setState(() => _icons[slot.key] = ThemeIconOverride.image(shrunk));
}
void _showPictureError() {
showDismissibleSnackBar(
context,
content: Text(context.l10n.themes_iconPictureFailed),
);
}
Future<void> _save() async {
final name = _nameController.text.trim();
if (name.isEmpty) {
// The name field sits at the top; bring it back into view so the
// error is seen rather than a button that seems to do nothing.
setState(() => _showNameError = true);
_nameFocus.requestFocus();
if (_scrollController.hasClients) {
await _scrollController.animateTo(
0,
duration: const Duration(milliseconds: 250),
curve: Curves.easeOut,
);
}
return;
}
final settingsService = context.read<AppSettingsService>();
final theme = _draft.copyWith(
id: widget.existing?.id ?? settingsService.newCustomThemeId(),
name: name,
);
await settingsService.saveCustomTheme(theme, apply: true);
if (mounted) Navigator.of(context).pop();
}
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final scheme = Theme.of(context).colorScheme;
final lowContrast = _contrastRatio(_accent, _background) < 3;
return Scaffold(
appBar: AppBar(
title: AdaptiveAppBarTitle(
widget.existing == null
? l10n.themes_newTitle
: l10n.themes_editTitle,
),
centerTitle: true,
),
body: SafeArea(
top: false,
child: ListView(
controller: _scrollController,
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
children: [
Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
child: TextField(
controller: _nameController,
focusNode: _nameFocus,
textCapitalization: TextCapitalization.words,
maxLength: 32,
style: Theme.of(context).textTheme.bodyLarge,
decoration: InputDecoration(
labelText: l10n.themes_name,
errorText: _showNameError ? l10n.themes_nameRequired : null,
),
onChanged: (_) {
if (_showNameError) setState(() => _showNameError = false);
},
),
),
SectionHeader(l10n.themes_preview),
_ThemePreview(theme: _draft),
if (lowContrast)
Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
child: Row(
children: [
Icon(Icons.warning_amber_rounded, color: scheme.tertiary),
const SizedBox(width: 8),
Expanded(
child: Text(
l10n.themes_lowContrast,
style: Theme.of(context).textTheme.bodyMedium,
),
),
],
),
),
SectionHeader(l10n.themes_background),
_ColorPicker(
help: l10n.themes_backgroundHelp,
swatches: kThemeBackgroundSwatches,
value: _background,
onChanged: (c) => setState(() => _background = c),
),
SectionHeader(l10n.themes_accent),
_ColorPicker(
help: l10n.themes_accentHelp,
swatches: kThemeAccentSwatches,
value: _accent,
onChanged: (c) => setState(() => _accent = c),
),
SectionHeader(l10n.themes_chatBackground),
MeshCard(
padding: const EdgeInsets.all(14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
l10n.themes_chatBackgroundHelp,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
),
const SizedBox(height: 12),
ChatBackgroundPicker(
value: _chatBackground,
onChanged: (value) =>
setState(() => _chatBackground = value),
),
if (_chatBackground != null)
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(l10n.themes_chatBackgroundEverywhere),
subtitle: Text(l10n.themes_chatBackgroundEverywhereHelp),
value: _chatBackgroundEverywhere,
onChanged: (value) =>
setState(() => _chatBackgroundEverywhere = value),
),
],
),
),
SectionHeader(l10n.themes_icons),
MeshCard(
padding: const EdgeInsets.symmetric(vertical: 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(14, 8, 14, 4),
child: Text(
l10n.themes_iconsHelp,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
),
),
for (final slot in ThemeIconSlot.values)
if (!slot.isMapMarker) _iconTile(slot),
],
),
),
SectionHeader(l10n.themes_mapMarkers),
MeshCard(
padding: const EdgeInsets.symmetric(vertical: 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(14, 8, 14, 4),
child: Text(
l10n.themes_mapMarkersHelp,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
),
),
for (final slot in ThemeIconSlot.values)
if (slot.isMapMarker) _iconTile(slot),
],
),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 24, 16, 0),
child: FilledButton.icon(
onPressed: _save,
icon: const Icon(Icons.check),
label: Text(l10n.themes_saveAndUse),
),
),
],
),
),
);
}
}
/// WCAG contrast ratio between two colors (1–21).
double _contrastRatio(Color a, Color b) {
final la = a.computeLuminance();
final lb = b.computeLuminance();
final hi = la > lb ? la : lb;
final lo = la > lb ? lb : la;
return (hi + 0.05) / (lo + 0.05);
}
class _ColorPicker extends StatefulWidget {
final String help;
final List<Color> swatches;
final Color value;
final ValueChanged<Color> onChanged;
const _ColorPicker({
required this.help,
required this.swatches,
required this.value,
required this.onChanged,
});
@override
State<_ColorPicker> createState() => _ColorPickerState();
}
class _ColorPickerState extends State<_ColorPicker> {
late final TextEditingController _hexController;
@override
void initState() {
super.initState();
_hexController = TextEditingController(text: colorToHex(widget.value));
}
@override
void didUpdateWidget(covariant _ColorPicker oldWidget) {
super.didUpdateWidget(oldWidget);
// Keep the text in step with swatch taps, but don't fight the user while
// they are mid-way through typing a hex value.
if (oldWidget.value != widget.value &&
parseHexColor(_hexController.text) != widget.value) {
_hexController.text = colorToHex(widget.value);
}
}
@override
void dispose() {
_hexController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return MeshCard(
padding: const EdgeInsets.all(14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.help,
style: Theme.of(
context,
).textTheme.bodyMedium?.copyWith(color: scheme.onSurfaceVariant),
),
const SizedBox(height: 12),
Wrap(
spacing: 10,
runSpacing: 10,
children: [
for (final color in widget.swatches)
_SwatchButton(
color: color,
selected: color == widget.value,
onTap: () => widget.onChanged(color),
),
],
),
const SizedBox(height: 14),
TextField(
controller: _hexController,
style: MeshTheme.mono(fontSize: 16),
decoration: InputDecoration(
labelText: context.l10n.themes_hexColor,
hintText: '#RRGGBB',
prefixIcon: Padding(
padding: const EdgeInsets.all(10),
child: Container(
width: 24,
height: 24,
decoration: BoxDecoration(
color: widget.value,
shape: BoxShape.circle,
border: Border.all(color: scheme.outline),
),
),
),
),
onChanged: (text) {
final color = parseHexColor(text);
if (color != null) widget.onChanged(color);
},
),
],
),
);
}
}
class _SwatchButton extends StatelessWidget {
final Color color;
final bool selected;
final VoidCallback onTap;
const _SwatchButton({
required this.color,
required this.selected,
required this.onTap,
});
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Semantics(
button: true,
selected: selected,
label: colorToHex(color),
child: InkWell(
onTap: onTap,
customBorder: const CircleBorder(),
child: Container(
width: 44,
height: 44,
decoration: BoxDecoration(
color: color,
shape: BoxShape.circle,
border: Border.all(
color: selected ? scheme.primary : scheme.outline,
width: selected ? 3 : 1,
),
),
child: selected
? Icon(
Icons.check,
color: isDarkColor(color) ? Colors.white : Colors.black,
)
: null,
),
),
);
}
}
/// A miniature screen rendered with the draft theme.
class _ThemePreview extends StatelessWidget {
final CustomTheme theme;
const _ThemePreview({required this.theme});
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final data = MeshTheme.fromCustom(theme);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Theme(
data: data,
child: Builder(
builder: (context) {
final scheme = Theme.of(context).colorScheme;
final textTheme = Theme.of(context).textTheme;
return Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: scheme.surface,
borderRadius: BorderRadius.circular(MeshRadii.md),
border: Border.all(color: scheme.outline),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 14,
vertical: 12,
),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: scheme.outlineVariant),
),
),
child: Text(
theme.name.isEmpty ? l10n.themes_newTitle : theme.name,
style: textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w600,
),
),
),
_PreviewChatArea(
background: theme.chatBackground,
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_bubble(context, l10n.themes_previewIncoming, false),
const SizedBox(height: 8),
_bubble(context, l10n.themes_previewOutgoing, true),
const SizedBox(height: 8),
Row(
children: [
Expanded(
child: Text(
l10n.themes_previewSwitch,
style: textTheme.bodyLarge,
),
),
Switch(value: true, onChanged: (_) {}),
],
),
Align(
alignment: Alignment.centerRight,
child: FilledButton(
onPressed: () {},
child: Text(l10n.common_save),
),
),
],
),
),
),
],
),
);
},
),
),
);
}
Widget _bubble(BuildContext context, String text, bool isOutgoing) {
final colors = MessageBubbleColors.of(context, isOutgoing: isOutgoing);
return Align(
alignment: isOutgoing ? Alignment.centerRight : Alignment.centerLeft,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: colors.background,
borderRadius: messageBubbleRadius(isOutgoing: isOutgoing),
border: Border.all(color: colors.border),
),
child: Text(
text,
style: Theme.of(
context,
).textTheme.bodyLarge?.copyWith(color: colors.text),
),
),
);
}
}
/// Readable name for an icon slot in the editor.
String themeIconSlotLabel(BuildContext context, ThemeIconSlot slot) {
final l10n = context.l10n;
switch (slot) {
case ThemeIconSlot.contacts:
return l10n.nav_contacts;
case ThemeIconSlot.channels:
return l10n.nav_channels;
case ThemeIconSlot.map:
return l10n.nav_map;
case ThemeIconSlot.send:
return l10n.themes_iconSend;
case ThemeIconSlot.settings:
return l10n.settings_title;
case ThemeIconSlot.repeater:
return l10n.themes_iconRepeater;
case ThemeIconSlot.room:
return l10n.themes_iconRoom;
case ThemeIconSlot.sensor:
return l10n.themes_iconSensor;
case ThemeIconSlot.mapChat:
return l10n.map_chat;
case ThemeIconSlot.mapRepeater:
return l10n.map_repeater;
case ThemeIconSlot.mapRoom:
return l10n.map_room;
case ThemeIconSlot.mapSensor:
return l10n.map_sensor;
case ThemeIconSlot.mapSelf:
return l10n.pathTrace_you;
}
}
/// Result of the icon picker: a new value (null = default) or a request to
/// pick a picture from the gallery.
class _IconChoice {
final ThemeIconOverride? value;
final bool pickPicture;
const _IconChoice(this.value) : pickPicture = false;
const _IconChoice.picture() : value = null, pickPicture = true;
}
class _IconPickerSheet extends StatelessWidget {
final ThemeIconSlot slot;
final ThemeIconOverride? current;
final String label;
const _IconPickerSheet({
required this.slot,
required this.current,
required this.label,
});
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final scheme = Theme.of(context).colorScheme;
return DraggableScrollableSheet(
expand: false,
initialChildSize: 0.7,
maxChildSize: 0.95,
builder: (context, scrollController) => ListView(
controller: scrollController,
padding: const EdgeInsets.fromLTRB(16, 0, 16, 24),
children: [
Text(label, style: Theme.of(context).textTheme.titleLarge),
const SizedBox(height: 16),
FilledButton.icon(
onPressed: () =>
Navigator.pop(context, const _IconChoice.picture()),
icon: const Icon(Icons.image_outlined),
label: Text(l10n.themes_iconUsePicture),
),
const SizedBox(height: 8),
OutlinedButton.icon(
onPressed: current == null
? null
: () => Navigator.pop(context, const _IconChoice(null)),
icon: Icon(slot.icon),
label: Text(l10n.themes_iconReset),
),
const SizedBox(height: 16),
GridView.count(
crossAxisCount: 5,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
mainAxisSpacing: 8,
crossAxisSpacing: 8,
children: [
for (final entry in kThemeIconCatalog.entries)
Semantics(
button: true,
selected: current?.icon == entry.key,
label: entry.key.replaceAll('_', ' '),
child: InkWell(
borderRadius: BorderRadius.circular(MeshRadii.sm),
onTap: () => Navigator.pop(
context,
_IconChoice(ThemeIconOverride.icon(entry.key)),
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(MeshRadii.sm),
color: current?.icon == entry.key
? scheme.primary.withValues(alpha: 0.16)
: scheme.surfaceContainerHigh,
border: Border.all(
color: current?.icon == entry.key
? scheme.primary
: scheme.outlineVariant,
),
),
child: Icon(entry.value, size: 30),
),
),
),
],
),
],
),
);
}
}
/// The preview's message area, drawn over the draft chat background.
class _PreviewChatArea extends StatelessWidget {
final ChatBackground? background;
final Widget child;
const _PreviewChatArea({required this.background, required this.child});
@override
Widget build(BuildContext context) {
final bg = background;
if (bg == null) return child;
return Stack(
children: [
Positioned.fill(child: ChatBackgroundLayer(background: bg)),
child,
],
);
}
}
+568
View File
@@ -0,0 +1,568 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../models/custom_theme.dart';
import '../services/app_settings_service.dart';
import '../services/chat_background_service.dart';
import '../theme/mesh_theme.dart';
import '../theme/theme_icons.dart';
import '../utils/theme_file.dart';
import '../widgets/adaptive_app_bar_title.dart';
import '../widgets/mesh_ui.dart';
import 'theme_editor_screen.dart';
/// Lists the stock theme, the built-in presets and the user's own themes.
/// Tapping a theme applies it immediately.
class ThemesScreen extends StatelessWidget {
const ThemesScreen({super.key});
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final settingsService = context.watch<AppSettingsService>();
// The theme actually showing, which may be an automatic holiday theme.
final activeId = settingsService.activeCustomTheme?.id;
final autoHoliday = settingsService.autoHolidayTheme;
final myThemes = settingsService.settings.customThemes;
return Scaffold(
appBar: AppBar(
title: AdaptiveAppBarTitle(l10n.themes_title),
centerTitle: true,
actions: [
PopupMenuButton<void>(
icon: const Icon(Icons.more_vert),
itemBuilder: (_) => [
PopupMenuItem(
onTap: () => _importFile(context, settingsService),
child: _MenuRow(
Icons.file_open_outlined,
l10n.themes_importFile,
),
),
PopupMenuItem(
onTap: () => _showImportDialog(context, settingsService),
child: _MenuRow(
Icons.content_paste_go_outlined,
l10n.themes_pasteCode,
),
),
PopupMenuItem(
enabled: myThemes.isNotEmpty,
onTap: () => _exportFile(context, myThemes, 'meshcore-themes'),
child: _MenuRow(Icons.ios_share, l10n.themes_exportAll),
),
],
),
],
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () => _openEditor(context),
icon: const Icon(Icons.add),
label: Text(l10n.themes_create),
),
body: SafeArea(
top: false,
child: ListView(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 96),
children: [
SectionHeader(l10n.themes_myThemes),
if (myThemes.isEmpty)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: Text(
l10n.themes_myThemesEmpty,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
)
else
for (final theme in myThemes)
_ThemeTile(
name: theme.name,
background: theme.background,
accent: theme.accent,
selected: theme.id == activeId,
onTap: () => settingsService.setActiveTheme(theme.id),
menu: _myThemeMenu(context, settingsService, theme),
),
SectionHeader(l10n.themes_builtIn),
_ThemeTile(
name: l10n.themes_default,
subtitle: l10n.themes_defaultSubtitle,
background: MeshPalette.bg,
accent: MeshPalette.blue,
selected: activeId == null,
onTap: () => settingsService.setActiveTheme(null),
),
for (final preset in CustomTheme.presets)
_presetTile(context, settingsService, preset, activeId),
SectionHeader(l10n.themes_holidays),
SwitchListTile(
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 4,
),
secondary: const Icon(Icons.event_available_outlined, size: 24),
title: Text(l10n.themes_holidayAutoSwitch),
subtitle: Text(l10n.themes_holidayAutoSwitchSubtitle),
value: settingsService.settings.holidayAutoSwitch,
onChanged: settingsService.setHolidayAutoSwitch,
),
if (autoHoliday != null)
_AutoHolidayNote(
l10n.themes_holidayAutoApplied(autoHoliday.name),
),
for (final preset in CustomTheme.holidayPresets)
_presetTile(
context,
settingsService,
preset,
activeId,
subtitle: preset.id == autoHoliday?.id
? l10n.themes_holidayAutoAppliedTag
: null,
),
],
),
),
);
}
Widget _presetTile(
BuildContext context,
AppSettingsService settingsService,
CustomTheme preset,
String? activeId, {
String? subtitle,
}) {
final l10n = context.l10n;
return _ThemeTile(
name: preset.name,
subtitle: subtitle,
background: preset.background,
accent: preset.accent,
preview: preset.icons.isEmpty
? null
: ThemedIcon.preview(
ThemeIconSlot.channels,
preset.icons[ThemeIconSlot.channels.key],
size: 48,
),
selected: preset.id == activeId,
onTap: () => settingsService.setActiveTheme(preset.id),
menu: PopupMenuButton<void>(
icon: const Icon(Icons.more_vert),
itemBuilder: (_) => [
PopupMenuItem(
onTap: () => _openEditor(
context,
startFrom: preset,
copyName: l10n.themes_copyName(preset.name),
),
child: _MenuRow(Icons.tune, l10n.themes_customize),
),
PopupMenuItem(
onTap: () => _copyCode(context, preset),
child: _MenuRow(Icons.copy, l10n.themes_copyCode),
),
],
),
);
}
Widget _myThemeMenu(
BuildContext context,
AppSettingsService settingsService,
CustomTheme theme,
) {
final l10n = context.l10n;
return PopupMenuButton<void>(
icon: const Icon(Icons.more_vert),
itemBuilder: (_) => [
PopupMenuItem(
onTap: () => _openEditor(context, existing: theme),
child: _MenuRow(Icons.edit_outlined, l10n.common_edit),
),
PopupMenuItem(
onTap: () => _copyCode(context, theme),
child: _MenuRow(Icons.copy, l10n.themes_copyCode),
),
PopupMenuItem(
onTap: () => _exportFile(context, [theme], themeFileStem(theme.name)),
child: _MenuRow(Icons.ios_share, l10n.themes_exportFile),
),
PopupMenuItem(
onTap: () => _confirmDelete(context, settingsService, theme),
child: _MenuRow(Icons.delete_outline, l10n.common_delete),
),
],
);
}
void _openEditor(
BuildContext context, {
CustomTheme? existing,
CustomTheme? startFrom,
String? copyName,
}) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => ThemeEditorScreen(
existing: existing,
startFrom: startFrom,
initialName: copyName,
),
),
);
}
Future<void> _exportFile(
BuildContext context,
List<CustomTheme> themes,
String fileStem,
) async {
final box = context.findRenderObject() as RenderBox?;
final origin = box == null
? null
: box.localToGlobal(Offset.zero) & box.size;
final backgrounds = context.read<ChatBackgroundService>();
final embedded = [
for (final theme in themes) await backgrounds.embedThemeImages(theme),
];
final result = await exportThemesFile(
embedded,
fileStem: fileStem,
sharePositionOrigin: origin,
);
if (result != ThemeFileResult.failed || !context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(context.l10n.themes_exportFailed),
);
}
Future<void> _importFile(
BuildContext context,
AppSettingsService settingsService,
) async {
final String? text;
try {
text = await pickThemesFile();
} catch (_) {
if (context.mounted) {
showDismissibleSnackBar(
context,
content: Text(context.l10n.themes_importFileNone),
);
}
return;
}
if (text == null || !context.mounted) return;
final backgrounds = context.read<ChatBackgroundService>();
final themes = [
for (final theme in decodeThemesJsonl(
text,
newId: settingsService.newCustomThemeId,
))
await backgrounds.storeThemeImages(theme),
];
final added = themes.isEmpty
? 0
: await settingsService.importCustomThemes(themes);
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(
themes.isEmpty
? context.l10n.themes_importFileNone
: context.l10n.themes_importFileResult(added),
),
);
}
Future<void> _copyCode(BuildContext context, CustomTheme theme) async {
final embedded = await context
.read<ChatBackgroundService>()
.embedThemeImages(theme);
await Clipboard.setData(ClipboardData(text: embedded.toShareCode()));
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(context.l10n.themes_codeCopied),
);
}
void _confirmDelete(
BuildContext context,
AppSettingsService settingsService,
CustomTheme theme,
) {
showDialog<void>(
context: context,
builder: (dialogContext) => AlertDialog(
title: Text(dialogContext.l10n.themes_deleteConfirm(theme.name)),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext),
child: Text(dialogContext.l10n.common_cancel),
),
TextButton(
onPressed: () {
Navigator.pop(dialogContext);
settingsService.deleteCustomTheme(theme.id);
},
child: Text(dialogContext.l10n.common_delete),
),
],
),
);
}
Future<void> _showImportDialog(
BuildContext context,
AppSettingsService settingsService,
) async {
final clipboard = await Clipboard.getData(Clipboard.kTextPlain);
if (!context.mounted) return;
final controller = TextEditingController(
text: CustomTheme.fromShareCode(clipboard?.text ?? '', newId: '') != null
? clipboard!.text!.trim()
: '',
);
final imported = await showDialog<CustomTheme>(
context: context,
builder: (dialogContext) {
String? error;
return StatefulBuilder(
builder: (dialogContext, setState) => AlertDialog(
title: Text(dialogContext.l10n.themes_import),
content: TextField(
controller: controller,
autofocus: true,
minLines: 2,
maxLines: 5,
decoration: InputDecoration(
hintText: dialogContext.l10n.themes_importHint,
errorText: error,
),
),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext),
child: Text(dialogContext.l10n.common_cancel),
),
FilledButton(
onPressed: () {
final theme = CustomTheme.fromShareCode(
controller.text,
newId: settingsService.newCustomThemeId(),
);
if (theme == null) {
setState(
() => error = dialogContext.l10n.themes_importInvalid,
);
return;
}
Navigator.pop(dialogContext, theme);
},
child: Text(dialogContext.l10n.themes_import),
),
],
),
);
},
);
controller.dispose();
if (imported == null || !context.mounted) return;
final stored = await context.read<ChatBackgroundService>().storeThemeImages(
imported,
);
await settingsService.saveCustomTheme(stored, apply: true);
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(context.l10n.themes_imported(stored.name)),
);
}
}
/// Explains that a holiday theme was switched on automatically and that the
/// user's own theme returns afterwards.
class _AutoHolidayNote extends StatelessWidget {
final String text;
const _AutoHolidayNote(this.text);
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Padding(
padding: const EdgeInsets.fromLTRB(16, 4, 16, 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.info_outline, size: 24, color: scheme.primary),
const SizedBox(width: 12),
Expanded(
child: Text(
text,
style: Theme.of(
context,
).textTheme.bodyMedium?.copyWith(color: scheme.onSurface),
),
),
],
),
);
}
}
class _MenuRow extends StatelessWidget {
final IconData icon;
final String label;
const _MenuRow(this.icon, this.label);
@override
Widget build(BuildContext context) {
return Row(
children: [
Icon(icon, size: 22),
const SizedBox(width: 12),
Flexible(child: Text(label)),
],
);
}
}
class _ThemeTile extends StatelessWidget {
final String name;
final String? subtitle;
final Color background;
final Color accent;
final bool selected;
final VoidCallback onTap;
final Widget? menu;
/// Shown instead of the color swatch (holiday themes show an icon).
final Widget? preview;
const _ThemeTile({
required this.name,
this.subtitle,
required this.background,
required this.accent,
required this.selected,
required this.onTap,
this.menu,
this.preview,
});
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
final textTheme = Theme.of(context).textTheme;
return Semantics(
selected: selected,
button: true,
child: MeshCard(
onTap: onTap,
padding: const EdgeInsets.fromLTRB(14, 10, 4, 10),
borderColor: selected ? scheme.primary : null,
child: Row(
children: [
preview ?? ThemeSwatch(background: background, accent: accent),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: textTheme.bodyLarge?.copyWith(
fontWeight: FontWeight.w600,
),
),
if (subtitle != null) ...[
const SizedBox(height: 2),
Text(
subtitle!,
style: textTheme.bodyMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
),
],
],
),
),
if (selected)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Icon(Icons.check_circle, color: scheme.primary),
),
if (menu != null) menu! else const SizedBox(width: 12),
],
),
),
);
}
}
/// A small rounded square showing a theme's background with an accent dot
/// and a sample text bar, so themes can be told apart at a glance.
class ThemeSwatch extends StatelessWidget {
final Color background;
final Color accent;
final double size;
const ThemeSwatch({
super.key,
required this.background,
required this.accent,
this.size = 48,
});
@override
Widget build(BuildContext context) {
final ink = isDarkColor(background)
? MeshPalette.ink
: MeshPalette.lightInk;
return Container(
width: size,
height: size,
decoration: BoxDecoration(
color: background,
borderRadius: BorderRadius.circular(MeshRadii.sm),
border: Border.all(color: Theme.of(context).colorScheme.outline),
),
padding: EdgeInsets.all(size * 0.18),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: size * 0.1,
width: size * 0.5,
decoration: BoxDecoration(
color: ink.withValues(alpha: 0.8),
borderRadius: BorderRadius.circular(size),
),
),
Align(
alignment: Alignment.bottomRight,
child: Container(
width: size * 0.32,
height: size * 0.32,
decoration: BoxDecoration(color: accent, shape: BoxShape.circle),
),
),
],
),
);
}
}
+211 -1
View File
@@ -1,6 +1,9 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import '../models/app_settings.dart';
import '../models/custom_theme.dart';
import '../models/holiday_schedule.dart';
import '../models/image_codec_support.dart';
import '../models/translation_support.dart';
@@ -12,6 +15,12 @@ import '../helpers/cyr2lat.dart';
class AppSettingsService extends ChangeNotifier {
static const String _settingsKey = 'app_settings';
/// [clock] supplies "now" for the holiday theme schedule; tests inject one.
AppSettingsService({DateTime Function()? clock})
: _clock = clock ?? DateTime.now;
final DateTime Function() _clock;
AppSettings _settings = AppSettings();
AppSettings get settings => _settings;
@@ -55,11 +64,14 @@ class AppSettingsService extends ChangeNotifier {
_settings = AppSettings();
Cyr2Lat.setCharMap(_settings.cyr2latCharMap);
}
_syncDateTimer();
}
Future<void> updateSettings(AppSettings newSettings) async {
_settings = newSettings;
Cyr2Lat.setCharMap(_settings.cyr2latCharMap);
_lastAutoHolidayKey = autoHoliday?.occurrenceKey;
_syncDateTimer();
notifyListeners();
final prefs = PrefsManager.instance;
@@ -234,8 +246,206 @@ class AppSettingsService extends ChangeNotifier {
);
}
/// Picks a stock light/dark/system mode and leaves any custom theme.
///
/// Counts as a manual choice: an automatically applied holiday theme is
/// skipped for the rest of that holiday.
Future<void> setThemeMode(String value) async {
await updateSettings(_settings.copyWith(themeMode: value));
await updateSettings(
_dismissAutoHoliday(
_settings.copyWith(themeMode: value, activeThemeId: null),
),
);
}
Future<void> setHolidayAnimationsEnabled(bool value) async {
await updateSettings(_settings.copyWith(holidayAnimationsEnabled: value));
}
/// The theme in use, or null for the stock theme: the automatic holiday
/// theme while one applies ([autoHolidayTheme]), otherwise the user's own
/// choice ([AppSettings.activeThemeId]).
CustomTheme? get activeCustomTheme =>
autoHolidayTheme ?? _themeById(_settings.activeThemeId);
/// The user's own chosen theme, ignoring any automatic holiday theme.
CustomTheme? get chosenCustomTheme => _themeById(_settings.activeThemeId);
CustomTheme? _themeById(String? id) {
if (id == null) return null;
return CustomTheme.presetById(id) ??
_settings.customThemes.where((t) => t.id == id).firstOrNull;
}
/// The holiday within its window today, if auto-switching is on and the
/// user has not overridden this occurrence. Null otherwise.
ActiveHoliday? get autoHoliday {
if (!_settings.holidayAutoSwitch) return null;
final holiday = activeHolidayFor(_clock());
if (holiday == null) return null;
if (_settings.holidayThemeDismissed == holiday.occurrenceKey) return null;
// The user picked this holiday's theme themselves: nothing to override.
if (_settings.activeThemeId == holiday.themeId) return null;
return holiday;
}
/// The holiday preset being applied automatically in place of the user's
/// own theme, or null when none is.
CustomTheme? get autoHolidayTheme {
final holiday = autoHoliday;
return holiday == null ? null : CustomTheme.presetById(holiday.themeId);
}
/// Marks the automatically applied holiday (if any) as overridden for this
/// occurrence, so a manual theme choice sticks until the holiday is over.
AppSettings _dismissAutoHoliday(AppSettings next) {
final holiday = autoHoliday;
if (holiday == null) return next;
return next.copyWith(holidayThemeDismissed: holiday.occurrenceKey);
}
/// Applies a custom or preset theme; null returns to the stock theme.
///
/// Picking a theme while a holiday theme is applied automatically keeps
/// the pick for the rest of that holiday. Picking the automatic holiday
/// theme itself changes nothing, so the user's own theme still returns
/// after the holiday.
Future<void> setActiveTheme(String? themeId) async {
final holiday = autoHoliday;
if (holiday != null && themeId == holiday.themeId) return;
await updateSettings(
_dismissAutoHoliday(_settings.copyWith(activeThemeId: themeId)),
);
}
/// Turns automatic holiday themes on or off. Turning it on also forgets an
/// earlier override, so the current holiday's theme shows again.
Future<void> setHolidayAutoSwitch(bool value) async {
await updateSettings(
_settings.copyWith(
holidayAutoSwitch: value,
holidayThemeDismissed: value ? null : _settings.holidayThemeDismissed,
),
);
}
// ---- date-change refresh --------------------------------------------------
// The automatic holiday theme depends on the date. Once [startDateWatch] has
// been called (the app does so at startup; tests normally don't), a timer
// wakes at the next local midnight, or after an hour at most in case the
// device slept through it, and tells listeners if the holiday theme
// changed. It only runs while auto-switching is on.
static const Duration _maxDateCheckInterval = Duration(hours: 1);
Timer? _dateTimer;
bool _dateWatchStarted = false;
String? _lastAutoHolidayKey;
/// Starts re-checking the automatic holiday theme when the date changes.
void startDateWatch() {
_dateWatchStarted = true;
_lastAutoHolidayKey = autoHoliday?.occurrenceKey;
_syncDateTimer();
}
void _syncDateTimer() {
final wanted = _dateWatchStarted && _settings.holidayAutoSwitch;
if (!wanted) {
_dateTimer?.cancel();
_dateTimer = null;
} else if (_dateTimer == null) {
_scheduleDateTimer();
}
}
void _scheduleDateTimer() {
final now = _clock();
// A second past midnight so a slightly early wake-up still sees the new
// day.
final nextMidnight = DateTime(now.year, now.month, now.day + 1, 0, 0, 1);
var delay = nextMidnight.difference(now);
if (delay > _maxDateCheckInterval) delay = _maxDateCheckInterval;
_dateTimer = Timer(delay, () {
_dateTimer = null;
checkDateChange();
_syncDateTimer();
});
}
/// Notifies listeners if the automatic holiday theme differs from the one
/// last seen. Called by the date timer; public so tests can drive it.
@visibleForTesting
void checkDateChange() {
final key = autoHoliday?.occurrenceKey;
if (key == _lastAutoHolidayKey) return;
_lastAutoHolidayKey = key;
notifyListeners();
}
@visibleForTesting
bool get hasDateTimer => _dateTimer != null;
@override
void dispose() {
_dateTimer?.cancel();
_dateTimer = null;
super.dispose();
}
/// Adds [theme] or replaces the saved theme with the same ID.
Future<void> saveCustomTheme(CustomTheme theme, {bool apply = false}) async {
final themes = List<CustomTheme>.from(_settings.customThemes);
final index = themes.indexWhere((t) => t.id == theme.id);
if (index >= 0) {
themes[index] = theme;
} else {
themes.add(theme);
}
final next = _settings.copyWith(
customThemes: themes,
activeThemeId: apply ? theme.id : _settings.activeThemeId,
);
// Applying a theme is a manual choice, like [setActiveTheme].
await updateSettings(apply ? _dismissAutoHoliday(next) : next);
}
Future<void> deleteCustomTheme(String themeId) async {
final themes = _settings.customThemes
.where((t) => t.id != themeId)
.toList();
await updateSettings(
_settings.copyWith(
customThemes: themes,
activeThemeId: _settings.activeThemeId == themeId
? null
: _settings.activeThemeId,
),
);
}
/// A fresh ID for a new custom theme.
/// The counter keeps IDs unique when several are made in the same tick
/// (bulk imports; web clocks only tick in milliseconds).
String newCustomThemeId() =>
'custom:${DateTime.now().microsecondsSinceEpoch}-${_themeIdCounter++}';
int _themeIdCounter = 0;
/// Adds [themes], skipping any identical (apart from ID) to a saved one.
/// Returns how many were added.
Future<int> importCustomThemes(List<CustomTheme> themes) async {
final existing = List<CustomTheme>.from(_settings.customThemes);
var added = 0;
for (final theme in themes) {
final duplicate = existing.any((t) => t == theme.copyWith(id: t.id));
if (duplicate) continue;
existing.add(theme);
added++;
}
if (added > 0) {
await updateSettings(_settings.copyWith(customThemes: existing));
}
return added;
}
Future<void> setLanguageOverride(String? value) async {
@@ -0,0 +1,7 @@
/// Platform-appropriate [ChatBackgroundImageStore], chosen at compile time
/// (`dart:io` files natively, preferences on web).
library;
export 'chat_background_image_store_base.dart';
export 'chat_background_image_store_stub.dart'
if (dart.library.io) 'chat_background_image_store_io.dart';
@@ -0,0 +1,26 @@
import 'dart:typed_data';
/// Stores chat background pictures by content ID.
abstract class ChatBackgroundImageStore {
Future<void> write(String id, Uint8List bytes);
Future<Uint8List?> read(String id);
Future<void> delete(String id);
Future<Set<String>> listIds();
}
/// For tests.
class InMemoryChatBackgroundImageStore implements ChatBackgroundImageStore {
final Map<String, Uint8List> images = {};
@override
Future<void> write(String id, Uint8List bytes) async => images[id] = bytes;
@override
Future<Uint8List?> read(String id) async => images[id];
@override
Future<void> delete(String id) async => images.remove(id);
@override
Future<Set<String>> listIds() async => images.keys.toSet();
}
@@ -0,0 +1,59 @@
import 'dart:io';
import 'dart:typed_data';
import 'package:path_provider/path_provider.dart';
import 'chat_background_image_store_base.dart';
ChatBackgroundImageStore createChatBackgroundImageStore() =>
_FileChatBackgroundImageStore();
/// One JPEG XL file per picture under `<app support>/chat_backgrounds/`.
class _FileChatBackgroundImageStore implements ChatBackgroundImageStore {
Directory? _dir;
Future<Directory> _directory() async {
final existing = _dir;
if (existing != null) return existing;
final base = await getApplicationSupportDirectory();
final dir = Directory('${base.path}/chat_backgrounds');
await dir.create(recursive: true);
return _dir = dir;
}
Future<File> _file(String id) async =>
File('${(await _directory()).path}/$id.jxl');
@override
Future<void> write(String id, Uint8List bytes) async {
final file = await _file(id);
final temp = File('${file.path}.tmp');
await temp.writeAsBytes(bytes, flush: true);
await temp.rename(file.path);
}
@override
Future<Uint8List?> read(String id) async {
final file = await _file(id);
if (!await file.exists()) return null;
return file.readAsBytes();
}
@override
Future<void> delete(String id) async {
final file = await _file(id);
if (await file.exists()) await file.delete();
}
@override
Future<Set<String>> listIds() async {
final dir = await _directory();
return dir
.listSync()
.whereType<File>()
.map((f) => f.uri.pathSegments.last)
.where((name) => name.endsWith('.jxl'))
.map((name) => name.substring(0, name.length - 4))
.toSet();
}
}
@@ -0,0 +1,42 @@
import 'dart:convert';
import 'dart:typed_data';
import '../storage/prefs_manager.dart';
import 'chat_background_image_store_base.dart';
ChatBackgroundImageStore createChatBackgroundImageStore() =>
_PrefsChatBackgroundImageStore();
/// Web: pictures are base64 in preferences (browser local storage). They are
/// small JPEG XL files, so a handful fit comfortably in the storage quota.
class _PrefsChatBackgroundImageStore implements ChatBackgroundImageStore {
static const _prefix = 'chat_bg_image_';
@override
Future<void> write(String id, Uint8List bytes) async {
await PrefsManager.instance.setString('$_prefix$id', base64Encode(bytes));
}
@override
Future<Uint8List?> read(String id) async {
final value = PrefsManager.instance.getString('$_prefix$id');
if (value == null) return null;
try {
return base64Decode(value);
} on FormatException {
return null;
}
}
@override
Future<void> delete(String id) async {
await PrefsManager.instance.remove('$_prefix$id');
}
@override
Future<Set<String>> listIds() async => PrefsManager.instance
.getKeys()
.where((k) => k.startsWith(_prefix))
.map((k) => k.substring(_prefix.length))
.toSet();
}
+237
View File
@@ -0,0 +1,237 @@
import 'dart:async';
import 'dart:convert';
import 'dart:ui' as ui;
import 'package:crypto/crypto.dart' as crypto;
import 'package:flutter/foundation.dart';
import 'package:koni_jxl_flutter/koni_jxl_flutter.dart';
import '../models/channel.dart';
import '../models/chat_background.dart';
import '../models/contact.dart';
import '../models/custom_theme.dart';
import '../storage/prefs_manager.dart';
import '../utils/app_logger.dart';
import 'app_settings_service.dart';
import 'chat_background_image_store.dart';
/// Chat backgrounds: one per channel or DM, plus the active theme's.
///
/// A chat's own background wins over the theme's, unless the theme turns on
/// [CustomTheme.chatBackgroundEverywhere]. Settings are global (not per
/// radio): channels are keyed by their PSK-derived storage ID and DMs by the
/// contact's public key, both of which identify the chat on any radio.
class ChatBackgroundService extends ChangeNotifier {
static const _prefsKey = 'chat_backgrounds_v1';
/// Longest side of a stored picture, in pixels.
static const int maxImageSide = 1080;
/// JPEG XL lossy "distance" (cjxl-style; 1 is visually lossless). A chat
/// background is shown faded behind messages, so 2 keeps it sharp at a
/// fraction of the size.
static const double jxlDistance = 2.0;
final AppSettingsService _settings;
final ChatBackgroundImageStore _images;
final Map<String, ChatBackground> _byChat = {};
final Map<String, Uint8List> _imageCache = {};
final Set<String> _loading = {};
ChatBackgroundService(this._settings, {ChatBackgroundImageStore? imageStore})
: _images = imageStore ?? createChatBackgroundImageStore() {
_load();
_settings.addListener(notifyListeners);
}
static String channelKey(Channel channel) =>
'channel:${channel.storageId ?? 'slot${channel.index}'}';
static String contactKey(Contact contact) =>
'contact:${contact.publicKeyHex}';
void _load() {
final raw = PrefsManager.instance.getString(_prefsKey);
if (raw == null) return;
try {
final decoded = jsonDecode(raw);
if (decoded is! Map) return;
decoded.forEach((key, value) {
final background = ChatBackground.fromJson(value);
if (key is! String || background == null) return;
if (background.color != null || background.imageId != null) {
_byChat[key] = background;
}
});
} catch (e) {
appLogger.warn('Could not read chat backgrounds: $e');
}
}
Future<void> _save() async {
await PrefsManager.instance.setString(
_prefsKey,
jsonEncode(_byChat.map((key, value) => MapEntry(key, value.toJson()))),
);
}
/// The background this chat has been given itself (ignoring the theme).
ChatBackground? chatBackground(String chatKey) => _byChat[chatKey];
/// The theme background that will override [chatKey]'s own, if any.
CustomTheme? get overridingTheme {
final theme = _settings.activeCustomTheme;
if (theme?.chatBackground == null || !theme!.chatBackgroundEverywhere) {
return null;
}
return theme;
}
/// What to draw behind [chatKey]'s messages, or null for none.
ChatBackground? resolve(String chatKey) {
final theme = _settings.activeCustomTheme;
final themed = theme?.chatBackground;
if (themed != null && theme!.chatBackgroundEverywhere) return themed;
return _byChat[chatKey] ?? themed;
}
Future<void> setChatBackground(
String chatKey,
ChatBackground? background,
) async {
if (background == null) {
_byChat.remove(chatKey);
} else {
_byChat[chatKey] = background;
}
notifyListeners();
await _save();
}
/// Cached picture bytes, or null while they load (listeners are notified
/// once they arrive).
Uint8List? imageBytes(String imageId) {
final cached = _imageCache[imageId];
if (cached != null) return cached;
if (_loading.add(imageId)) {
unawaited(
_images.read(imageId).then((bytes) {
_loading.remove(imageId);
if (bytes == null) return;
_imageCache[imageId] = bytes;
notifyListeners();
}),
);
}
return null;
}
/// Shrinks a picture (any format Flutter or JPEG XL decodes), re-encodes
/// it as JPEG XL and stores it. Returns its ID, or null when [bytes] is not
/// a readable image.
Future<String?> addImage(Uint8List bytes) async {
final jxl = await encodeChatBackgroundJxl(bytes);
if (jxl == null) return null;
final id = crypto.sha256.convert(jxl).toString().substring(0, 20);
_imageCache[id] = jxl;
await _images.write(id, jxl);
return id;
}
/// Writes any picture carried inline by [theme] (from a share code or
/// file) to the image store, so the theme can be saved in settings.
Future<CustomTheme> storeThemeImages(CustomTheme theme) async {
final background = theme.chatBackground;
final inline = background?.inlineImage;
if (background == null || inline == null) return theme;
// Re-encode untrusted input rather than storing it verbatim.
final id = await addImage(inline);
return id == null
? theme.copyWith(chatBackground: null)
: theme.copyWith(chatBackground: background.withStoredImage(id));
}
/// Attaches the picture bytes to [theme] so its share code or file
/// carries the picture.
Future<CustomTheme> embedThemeImages(CustomTheme theme) async {
final background = theme.chatBackground;
final id = background?.imageId;
if (background == null || id == null) return theme;
final bytes = _imageCache[id] ?? await _images.read(id);
if (bytes == null) return theme;
return theme.copyWith(chatBackground: background.withInlineImage(bytes));
}
/// Deletes stored pictures no chat or saved theme uses any more.
Future<void> collectGarbage() async {
final inUse = <String>{
for (final background in _byChat.values)
if (background.imageId != null) background.imageId!,
for (final theme in _settings.settings.customThemes)
if (theme.chatBackground?.imageId != null)
theme.chatBackground!.imageId!,
};
try {
for (final id in await _images.listIds()) {
if (inUse.contains(id)) continue;
await _images.delete(id);
_imageCache.remove(id);
}
} catch (e) {
appLogger.warn('Chat background cleanup failed: $e');
}
}
@override
void dispose() {
_settings.removeListener(notifyListeners);
super.dispose();
}
}
/// Decodes [bytes], shrinks the picture to fit
/// [ChatBackgroundService.maxImageSide] and encodes it as lossy JPEG XL.
/// Returns null for unreadable input.
///
/// Non-JXL input goes through Flutter's decoder, which also applies a
/// photo's EXIF rotation.
Future<Uint8List?> encodeChatBackgroundJxl(Uint8List bytes) async {
const maxSide = ChatBackgroundService.maxImageSide;
ui.Image? image;
try {
if (looksLikeJxl(bytes)) {
image = await decodeJxlToUiImage(
bytes,
cacheWidth: maxSide,
cacheHeight: maxSide,
);
} else {
final buffer = await ui.ImmutableBuffer.fromUint8List(bytes);
final codec = await ui.instantiateImageCodecWithSize(
buffer,
getTargetSize: (width, height) {
final longest = width > height ? width : height;
if (longest <= maxSide) {
return ui.TargetImageSize(width: width, height: height);
}
final scale = maxSide / longest;
return ui.TargetImageSize(
width: (width * scale).round().clamp(1, maxSide),
height: (height * scale).round().clamp(1, maxSide),
);
},
);
image = (await codec.getNextFrame()).image;
codec.dispose();
}
return await encodeJxlLossyFromUiImage(
image,
distance: ChatBackgroundService.jxlDistance,
);
} catch (e) {
appLogger.warn('Could not encode chat background: $e');
return null;
} finally {
image?.dispose();
}
}
Loaded 100 of 124 files, more files were not shown because too many files have changed in this diff. Show more