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:
1 parent
780183b586
commit
4a574185e8
124 files changed
+12686
-292
No files matched your search
@@ -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
@@ -3455,5 +3455,9 @@
|
||||
"networkMap_manage": "Управление",
|
||||
"networkMap_addedToContacts": "Добавено към контактите",
|
||||
"networkMap_addFailed": "Неуспешно добавяне към контактите",
|
||||
"networkMap_unnamed": "Неназован повторител"
|
||||
"networkMap_unnamed": "Неназован повторител",
|
||||
"holidayGreeting_halloween": "Честит Хелоуин|Весел Хелоуин",
|
||||
"holidayGreeting_thanksgiving": "Честит Ден на благодарността",
|
||||
"holidayGreeting_christmas": "Весела Коледа|Честито Рождество",
|
||||
"holidayGreeting_newYear": "Честита Нова година|Щастлива Нова година"
|
||||
}
|
||||
+5
-1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -3589,5 +3589,9 @@
|
||||
},
|
||||
"networkMap_sourceLocalHint": "ラジオが受信したノード",
|
||||
"networkMap_sourceOnlineHint": "オンラインネットワークマップのリピータ",
|
||||
"networkMap_sourceBothHint": "ラジオのノードとオンラインネットワークマップ"
|
||||
"networkMap_sourceBothHint": "ラジオのノードとオンラインネットワークマップ",
|
||||
"holidayGreeting_halloween": "ハッピーハロウィン|ハッピーハロウィーン",
|
||||
"holidayGreeting_thanksgiving": "ハッピーサンクスギビング|感謝祭おめでとう",
|
||||
"holidayGreeting_christmas": "メリークリスマス",
|
||||
"holidayGreeting_newYear": "あけましておめでとう|明けましておめでとう|ハッピーニューイヤー"
|
||||
}
|
||||
+5
-1
@@ -3589,5 +3589,9 @@
|
||||
},
|
||||
"networkMap_sourceLocalHint": "내 라디오가 수신한 노드",
|
||||
"networkMap_sourceOnlineHint": "온라인 네트워크 지도의 리피터",
|
||||
"networkMap_sourceBothHint": "내 라디오의 노드와 온라인 네트워크 지도"
|
||||
"networkMap_sourceBothHint": "내 라디오의 노드와 온라인 네트워크 지도",
|
||||
"holidayGreeting_halloween": "해피 할로윈|즐거운 할로윈",
|
||||
"holidayGreeting_thanksgiving": "해피 땡스기빙|즐거운 추수감사절|행복한 추수감사절",
|
||||
"holidayGreeting_christmas": "메리 크리스마스|즐거운 성탄절",
|
||||
"holidayGreeting_newYear": "새해 복 많이 받으세요|새해 복 많이 받아|해피 뉴 이어"
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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 =>
|
||||
'Честита Нова година|Щастлива Нова година';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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 => 'あけましておめでとう|明けましておめでとう|ハッピーニューイヤー';
|
||||
}
|
||||
@@ -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 => '새해 복 많이 받으세요|새해 복 많이 받아|해피 뉴 이어';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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 => 'С Новым годом';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
@@ -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 => 'З Новим роком';
|
||||
}
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -2752,5 +2752,9 @@
|
||||
"networkMap_manage": "Управлять",
|
||||
"networkMap_addedToContacts": "Добавлено в контакты",
|
||||
"networkMap_addFailed": "Не удалось добавить в контакты",
|
||||
"networkMap_unnamed": "Репитер без имени"
|
||||
"networkMap_unnamed": "Репитер без имени",
|
||||
"holidayGreeting_halloween": "С Хэллоуином|С Хеллоуином|Счастливого Хэллоуина",
|
||||
"holidayGreeting_thanksgiving": "С Днём благодарения|С Днем благодарения",
|
||||
"holidayGreeting_christmas": "С Рождеством|Счастливого Рождества",
|
||||
"holidayGreeting_newYear": "С Новым годом"
|
||||
}
|
||||
+5
-1
@@ -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
@@ -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
@@ -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
@@ -3435,5 +3435,9 @@
|
||||
"networkMap_manage": "Керувати",
|
||||
"networkMap_addedToContacts": "Додано до контактів",
|
||||
"networkMap_addFailed": "Не вдалося додати до контактів",
|
||||
"networkMap_unnamed": "Ретранслятор без назви"
|
||||
"networkMap_unnamed": "Ретранслятор без назви",
|
||||
"holidayGreeting_halloween": "З Гелловіном|З Хелловіном|Щасливого Гелловіну",
|
||||
"holidayGreeting_thanksgiving": "З Днем подяки",
|
||||
"holidayGreeting_christmas": "З Різдвом|Веселого Різдва|Щасливого Різдва",
|
||||
"holidayGreeting_newYear": "З Новим роком"
|
||||
}
|
||||
+5
-1
@@ -3460,5 +3460,9 @@
|
||||
},
|
||||
"networkMap_sourceLocalHint": "你的无线电听到的节点",
|
||||
"networkMap_sourceOnlineHint": "来自在线网络地图的中继器",
|
||||
"networkMap_sourceBothHint": "你的无线电节点加上在线网络地图"
|
||||
"networkMap_sourceBothHint": "你的无线电节点加上在线网络地图",
|
||||
"holidayGreeting_halloween": "万圣节快乐|萬聖節快樂",
|
||||
"holidayGreeting_thanksgiving": "感恩节快乐|感恩節快樂",
|
||||
"holidayGreeting_christmas": "圣诞快乐|聖誕快樂",
|
||||
"holidayGreeting_newYear": "新年快乐|新年快樂"
|
||||
}
|
||||
+20
-5
@@ -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);
|
||||
|
||||
@@ -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?,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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'),
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
|
||||
import '../models/app_settings.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import 'app_settings_service.dart';
|
||||
|
||||
enum MapRasterSourcePreset {
|
||||
@@ -506,6 +507,19 @@ class MapTileCacheService extends ChangeNotifier {
|
||||
layer = ColorFiltered(colorFilter: filter, child: layer);
|
||||
}
|
||||
|
||||
// Custom themes wash their background color over the tiles so the map
|
||||
// matches the rest of the app. Kept light so roads and labels stay clear.
|
||||
final tint = MeshMapTheme.of(context).tileTint;
|
||||
if (tint != null) {
|
||||
layer = ColorFiltered(
|
||||
colorFilter: ColorFilter.mode(
|
||||
tint.withValues(alpha: MeshMapTheme.tileTintStrength),
|
||||
BlendMode.srcATop,
|
||||
),
|
||||
child: layer,
|
||||
);
|
||||
}
|
||||
|
||||
if (opacity < 1) {
|
||||
layer = Opacity(opacity: opacity, child: layer);
|
||||
}
|
||||
|
||||
+165
-3
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../models/custom_theme.dart';
|
||||
import 'theme_icons.dart';
|
||||
|
||||
/// MeshCore palette — high-contrast slate surfaces with sky-blue accents.
|
||||
class MeshPalette {
|
||||
MeshPalette._();
|
||||
@@ -157,6 +160,98 @@ class MeshRadii {
|
||||
static const pill = 999.0;
|
||||
}
|
||||
|
||||
/// Map colors. The stock themes keep the map's own high-contrast palette;
|
||||
/// custom themes tint the tiles and use their accent and surfaces.
|
||||
@immutable
|
||||
class MeshMapTheme extends ThemeExtension<MeshMapTheme> {
|
||||
/// Selection, own-position and route color.
|
||||
final Color accent;
|
||||
|
||||
/// Washed over map tiles; null leaves tiles untouched.
|
||||
final Color? tileTint;
|
||||
|
||||
/// True for custom themes: map overlays use the theme's colors instead of
|
||||
/// [MapPalette]'s fixed dark panels.
|
||||
final bool followsTheme;
|
||||
|
||||
const MeshMapTheme({
|
||||
required this.accent,
|
||||
this.tileTint,
|
||||
this.followsTheme = false,
|
||||
});
|
||||
|
||||
static const standard = MeshMapTheme(accent: MapPalette.selected);
|
||||
|
||||
/// How strongly [tileTint] colors the tiles.
|
||||
static const double tileTintStrength = 0.22;
|
||||
|
||||
static MeshMapTheme of(BuildContext context) =>
|
||||
Theme.of(context).extension<MeshMapTheme>() ?? standard;
|
||||
|
||||
@override
|
||||
MeshMapTheme copyWith({Color? accent, Color? tileTint, bool? followsTheme}) {
|
||||
return MeshMapTheme(
|
||||
accent: accent ?? this.accent,
|
||||
tileTint: tileTint ?? this.tileTint,
|
||||
followsTheme: followsTheme ?? this.followsTheme,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
MeshMapTheme lerp(MeshMapTheme? other, double t) {
|
||||
if (other == null) return this;
|
||||
return MeshMapTheme(
|
||||
accent: Color.lerp(accent, other.accent, t)!,
|
||||
tileTint: Color.lerp(tileTint, other.tileTint, t),
|
||||
followsTheme: t < 0.5 ? followsTheme : other.followsTheme,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Colors for your own (outgoing) chat bubbles. Part of the theme so custom
|
||||
/// themes can tint them with their accent.
|
||||
@immutable
|
||||
class MeshBubbleTheme extends ThemeExtension<MeshBubbleTheme> {
|
||||
final Color me;
|
||||
final Color meBorder;
|
||||
final Color meInk;
|
||||
|
||||
const MeshBubbleTheme({
|
||||
required this.me,
|
||||
required this.meBorder,
|
||||
required this.meInk,
|
||||
});
|
||||
|
||||
/// The stock dusk-blue bubble used by the built-in light and dark themes.
|
||||
static const standard = MeshBubbleTheme(
|
||||
me: MeshPalette.me,
|
||||
meBorder: MeshPalette.meBorder,
|
||||
meInk: MeshPalette.meInk,
|
||||
);
|
||||
|
||||
static MeshBubbleTheme of(BuildContext context) =>
|
||||
Theme.of(context).extension<MeshBubbleTheme>() ?? standard;
|
||||
|
||||
@override
|
||||
MeshBubbleTheme copyWith({Color? me, Color? meBorder, Color? meInk}) {
|
||||
return MeshBubbleTheme(
|
||||
me: me ?? this.me,
|
||||
meBorder: meBorder ?? this.meBorder,
|
||||
meInk: meInk ?? this.meInk,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
MeshBubbleTheme lerp(MeshBubbleTheme? other, double t) {
|
||||
if (other == null) return this;
|
||||
return MeshBubbleTheme(
|
||||
me: Color.lerp(me, other.me, t)!,
|
||||
meBorder: Color.lerp(meBorder, other.meBorder, t)!,
|
||||
meInk: Color.lerp(meInk, other.meInk, t)!,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Shared helpers exposed via [MeshTheme.of].
|
||||
class MeshTheme {
|
||||
MeshTheme._();
|
||||
@@ -195,7 +290,13 @@ class MeshTheme {
|
||||
onInverseSurface: MeshPalette.bg,
|
||||
inversePrimary: MeshPalette.blueDim,
|
||||
);
|
||||
return _build(scheme, Brightness.dark);
|
||||
return _build(
|
||||
scheme,
|
||||
Brightness.dark,
|
||||
MeshBubbleTheme.standard,
|
||||
MeshIconTheme.none,
|
||||
MeshMapTheme.standard,
|
||||
);
|
||||
}
|
||||
|
||||
static ThemeData light() {
|
||||
@@ -227,10 +328,70 @@ class MeshTheme {
|
||||
outline: MeshPalette.lightLine,
|
||||
outlineVariant: Color(0xFFD8DEE5),
|
||||
);
|
||||
return _build(scheme, Brightness.light);
|
||||
return _build(
|
||||
scheme,
|
||||
Brightness.light,
|
||||
MeshBubbleTheme.standard,
|
||||
MeshIconTheme.none,
|
||||
MeshMapTheme.standard,
|
||||
);
|
||||
}
|
||||
|
||||
static ThemeData _build(ColorScheme scheme, Brightness brightness) {
|
||||
/// Builds a full theme from a user's two-color [CustomTheme].
|
||||
///
|
||||
/// Surfaces are stepped from the background toward the text color, so any
|
||||
/// background yields evenly separated cards, inputs and borders. Text is
|
||||
/// near-white on dark backgrounds and near-black on light ones. Status
|
||||
/// colors (warning, error, secondary) come from the stock theme of the
|
||||
/// same brightness so they keep their meaning.
|
||||
static ThemeData fromCustom(CustomTheme custom) {
|
||||
final dark = custom.isDark;
|
||||
final bg = custom.background;
|
||||
final accent = custom.accent;
|
||||
final ink = dark ? MeshPalette.ink : MeshPalette.lightInk;
|
||||
Color step(double t) => Color.lerp(bg, ink, t)!;
|
||||
Color onColor(Color c) =>
|
||||
isDarkColor(c) ? Colors.white : MeshPalette.lightInk;
|
||||
|
||||
final base = (dark ? MeshTheme.dark() : MeshTheme.light()).colorScheme;
|
||||
final primaryContainer = Color.lerp(bg, accent, 0.4)!;
|
||||
final scheme = base.copyWith(
|
||||
primary: accent,
|
||||
onPrimary: onColor(accent),
|
||||
primaryContainer: primaryContainer,
|
||||
onPrimaryContainer: onColor(primaryContainer),
|
||||
surface: bg,
|
||||
onSurface: ink,
|
||||
surfaceContainerLowest: bg,
|
||||
surfaceContainerLow: step(dark ? 0.04 : 0.035),
|
||||
surfaceContainer: step(dark ? 0.04 : 0.035),
|
||||
surfaceContainerHigh: step(dark ? 0.08 : 0.07),
|
||||
surfaceContainerHighest: step(dark ? 0.13 : 0.11),
|
||||
onSurfaceVariant: step(dark ? 0.8 : 0.75),
|
||||
outline: step(dark ? 0.28 : 0.24),
|
||||
outlineVariant: step(dark ? 0.15 : 0.13),
|
||||
inverseSurface: ink,
|
||||
onInverseSurface: bg,
|
||||
inversePrimary: Color.lerp(accent, bg, 0.3),
|
||||
);
|
||||
|
||||
final me = Color.lerp(bg, accent, dark ? 0.35 : 0.22)!;
|
||||
return _build(
|
||||
scheme,
|
||||
dark ? Brightness.dark : Brightness.light,
|
||||
MeshBubbleTheme(me: me, meBorder: accent, meInk: onColor(me)),
|
||||
MeshIconTheme(custom.icons),
|
||||
MeshMapTheme(accent: accent, tileTint: bg, followsTheme: true),
|
||||
);
|
||||
}
|
||||
|
||||
static ThemeData _build(
|
||||
ColorScheme scheme,
|
||||
Brightness brightness,
|
||||
MeshBubbleTheme bubble,
|
||||
MeshIconTheme icons,
|
||||
MeshMapTheme map,
|
||||
) {
|
||||
final baseText =
|
||||
Typography.material2021(
|
||||
platform: TargetPlatform.android,
|
||||
@@ -244,6 +405,7 @@ class MeshTheme {
|
||||
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
extensions: [bubble, icons, map],
|
||||
brightness: brightness,
|
||||
colorScheme: scheme,
|
||||
scaffoldBackgroundColor: scheme.surface,
|
||||
|
||||
@@ -0,0 +1,379 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:koni_jxl_flutter/koni_jxl_flutter.dart';
|
||||
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
|
||||
/// The app icons a theme can replace. [key] is what themes store, so it must
|
||||
/// never change once released.
|
||||
enum ThemeIconSlot {
|
||||
contacts('contacts', Icons.people_outline, Icons.people),
|
||||
channels('channels', Icons.tag, Icons.tag),
|
||||
map('map', Icons.map_outlined, Icons.map),
|
||||
send('send', Icons.send, Icons.send),
|
||||
settings('settings', Icons.settings, Icons.settings),
|
||||
repeater('repeater', Icons.cell_tower, Icons.cell_tower),
|
||||
room('room', Icons.meeting_room, Icons.meeting_room),
|
||||
sensor('sensor', Icons.sensors, Icons.sensors),
|
||||
|
||||
// Map markers.
|
||||
mapChat('map_chat', Icons.person, Icons.person),
|
||||
mapRepeater('map_repeater', Icons.router, Icons.router),
|
||||
mapRoom('map_room', Icons.meeting_room, Icons.meeting_room),
|
||||
mapSensor('map_sensor', Icons.sensors, Icons.sensors),
|
||||
mapSelf('map_self', Icons.person_pin_circle, Icons.person_pin_circle);
|
||||
|
||||
/// Whether this slot is a marker on the map (grouped apart in the editor).
|
||||
bool get isMapMarker => key.startsWith('map_');
|
||||
|
||||
/// The slot showing the same node type elsewhere: list avatar <-> map
|
||||
/// marker. Null when there is none.
|
||||
ThemeIconSlot? get partner => switch (this) {
|
||||
ThemeIconSlot.repeater => ThemeIconSlot.mapRepeater,
|
||||
ThemeIconSlot.room => ThemeIconSlot.mapRoom,
|
||||
ThemeIconSlot.sensor => ThemeIconSlot.mapSensor,
|
||||
ThemeIconSlot.mapRepeater => ThemeIconSlot.repeater,
|
||||
ThemeIconSlot.mapRoom => ThemeIconSlot.room,
|
||||
ThemeIconSlot.mapSensor => ThemeIconSlot.sensor,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
final String key;
|
||||
final IconData icon;
|
||||
|
||||
/// Variant shown when the slot is selected (e.g. the active nav tab).
|
||||
final IconData selectedIcon;
|
||||
|
||||
const ThemeIconSlot(this.key, this.icon, this.selectedIcon);
|
||||
}
|
||||
|
||||
/// A theme's replacement for one [ThemeIconSlot]: either a named icon from
|
||||
/// [kThemeIconCatalog] or a small picture (PNG, base64 in JSON).
|
||||
@immutable
|
||||
class ThemeIconOverride {
|
||||
/// Key in [kThemeIconCatalog].
|
||||
final String? icon;
|
||||
|
||||
/// Base64-encoded picture (JPEG XL; older themes may hold PNG).
|
||||
final String? image;
|
||||
|
||||
/// Decoded once so the image provider keeps hitting the same cache entry.
|
||||
final Uint8List? imageBytes;
|
||||
|
||||
/// A JPEG XL picture bundled with the app (see [isThemeAssetPath]).
|
||||
final String? asset;
|
||||
|
||||
const ThemeIconOverride.icon(String this.icon)
|
||||
: image = null,
|
||||
imageBytes = null,
|
||||
asset = null;
|
||||
|
||||
ThemeIconOverride.image(Uint8List bytes)
|
||||
: icon = null,
|
||||
image = base64Encode(bytes),
|
||||
imageBytes = bytes,
|
||||
asset = null;
|
||||
|
||||
const ThemeIconOverride.asset(String this.asset)
|
||||
: icon = null,
|
||||
image = null,
|
||||
imageBytes = null;
|
||||
|
||||
const ThemeIconOverride._(this.icon, this.image, this.imageBytes)
|
||||
: asset = null;
|
||||
|
||||
Map<String, dynamic> toJson() => image != null
|
||||
? {'image': image}
|
||||
: asset != null
|
||||
? {'asset': asset}
|
||||
: {'icon': icon};
|
||||
|
||||
/// Returns null for unknown icon names or unreadable pictures, so a bad
|
||||
/// entry in a shared code falls back to the default icon.
|
||||
static ThemeIconOverride? fromJson(Object? json) {
|
||||
if (json is! Map) return null;
|
||||
final image = json['image'];
|
||||
if (image is String && image.isNotEmpty) {
|
||||
try {
|
||||
return ThemeIconOverride._(null, image, base64Decode(image));
|
||||
} on FormatException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
final asset = json['asset'];
|
||||
if (isThemeAssetPath(asset)) {
|
||||
return ThemeIconOverride.asset(asset as String);
|
||||
}
|
||||
final icon = json['icon'];
|
||||
if (icon is String && kThemeIconCatalog.containsKey(icon)) {
|
||||
return ThemeIconOverride.icon(icon);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
other is ThemeIconOverride &&
|
||||
other.icon == icon &&
|
||||
other.image == image &&
|
||||
other.asset == asset;
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(icon, image, asset);
|
||||
}
|
||||
|
||||
/// The map marker slot for a node type, or null for unknown types.
|
||||
ThemeIconSlot? mapMarkerSlotForNodeType(int type) {
|
||||
switch (type) {
|
||||
case advTypeChat:
|
||||
return ThemeIconSlot.mapChat;
|
||||
case advTypeRepeater:
|
||||
return ThemeIconSlot.mapRepeater;
|
||||
case advTypeRoom:
|
||||
return ThemeIconSlot.mapRoom;
|
||||
case advTypeSensor:
|
||||
return ThemeIconSlot.mapSensor;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// Image provider for a picture override, or null for a named icon.
|
||||
ImageProvider? themePictureOf(ThemeIconOverride? override) {
|
||||
final bytes = override?.imageBytes;
|
||||
if (bytes != null) return themePictureProvider(bytes);
|
||||
final asset = override?.asset;
|
||||
if (asset != null) return JxlImageProvider.asset(asset);
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Folder holding the pictures of the built-in themes.
|
||||
const String kThemeAssetDir = 'assets/themes/';
|
||||
|
||||
/// Whether [value] names a bundled theme picture. Shared codes may only
|
||||
/// point inside [kThemeAssetDir], and only at JPEG XL files.
|
||||
bool isThemeAssetPath(Object? value) =>
|
||||
value is String &&
|
||||
value.startsWith(kThemeAssetDir) &&
|
||||
value.endsWith('.jxl') &&
|
||||
!value.contains('..');
|
||||
|
||||
/// Image provider for theme picture bytes: JPEG XL, or PNG/JPEG from themes
|
||||
/// made before pictures were stored as JPEG XL.
|
||||
ImageProvider themePictureProvider(Uint8List bytes) =>
|
||||
looksLikeJxl(bytes) ? JxlImageProvider.memory(bytes) : MemoryImage(bytes);
|
||||
|
||||
/// Parses a theme's `icons` JSON object, keeping only known slots.
|
||||
Map<String, ThemeIconOverride> parseThemeIcons(Object? json) {
|
||||
if (json is! Map) return const {};
|
||||
final knownKeys = ThemeIconSlot.values.map((s) => s.key).toSet();
|
||||
final result = <String, ThemeIconOverride>{};
|
||||
json.forEach((key, value) {
|
||||
if (key is! String || !knownKeys.contains(key)) return;
|
||||
final override = ThemeIconOverride.fromJson(value);
|
||||
if (override != null) result[key] = override;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Icons offered in the picker, by the name themes store.
|
||||
const Map<String, IconData> kThemeIconCatalog = {
|
||||
'people': Icons.people,
|
||||
'person': Icons.person,
|
||||
'groups': Icons.groups,
|
||||
'contacts': Icons.contacts,
|
||||
'forum': Icons.forum,
|
||||
'chat': Icons.chat,
|
||||
'chat_bubble': Icons.chat_bubble,
|
||||
'mail': Icons.mail,
|
||||
'tag': Icons.tag,
|
||||
'campaign': Icons.campaign,
|
||||
'podcasts': Icons.podcasts,
|
||||
'radio': Icons.radio,
|
||||
'map': Icons.map,
|
||||
'public': Icons.public,
|
||||
'explore': Icons.explore,
|
||||
'place': Icons.place,
|
||||
'near_me': Icons.near_me,
|
||||
'terrain': Icons.terrain,
|
||||
'send': Icons.send,
|
||||
'rocket_launch': Icons.rocket_launch,
|
||||
'arrow_upward': Icons.arrow_upward,
|
||||
'north_east': Icons.north_east,
|
||||
'flight': Icons.flight,
|
||||
'bolt': Icons.bolt,
|
||||
'settings': Icons.settings,
|
||||
'tune': Icons.tune,
|
||||
'build': Icons.build,
|
||||
'menu': Icons.menu,
|
||||
'cell_tower': Icons.cell_tower,
|
||||
'router': Icons.router,
|
||||
'wifi_tethering': Icons.wifi_tethering,
|
||||
'satellite_alt': Icons.satellite_alt,
|
||||
'meeting_room': Icons.meeting_room,
|
||||
'home': Icons.home,
|
||||
'cabin': Icons.cabin,
|
||||
'castle': Icons.castle,
|
||||
'sensors': Icons.sensors,
|
||||
'thermostat': Icons.thermostat,
|
||||
'water_drop': Icons.water_drop,
|
||||
'eco': Icons.eco,
|
||||
'star': Icons.star,
|
||||
'favorite': Icons.favorite,
|
||||
'pets': Icons.pets,
|
||||
'hiking': Icons.hiking,
|
||||
'sailing': Icons.sailing,
|
||||
'anchor': Icons.anchor,
|
||||
'local_fire_department': Icons.local_fire_department,
|
||||
'shield': Icons.shield,
|
||||
'emoji_emotions': Icons.emoji_emotions,
|
||||
'auto_awesome': Icons.auto_awesome,
|
||||
'nightlight': Icons.nightlight,
|
||||
'wb_sunny': Icons.wb_sunny,
|
||||
'park': Icons.park,
|
||||
'diamond': Icons.diamond,
|
||||
};
|
||||
|
||||
/// Icon overrides carried by the active theme.
|
||||
@immutable
|
||||
class MeshIconTheme extends ThemeExtension<MeshIconTheme> {
|
||||
final Map<String, ThemeIconOverride> overrides;
|
||||
|
||||
const MeshIconTheme(this.overrides);
|
||||
|
||||
static const none = MeshIconTheme({});
|
||||
|
||||
static MeshIconTheme of(BuildContext context) =>
|
||||
Theme.of(context).extension<MeshIconTheme>() ?? none;
|
||||
|
||||
/// The replacement for [slot]. A node type's list avatar and its map
|
||||
/// marker stand for the same thing, so when a theme sets only one of the
|
||||
/// pair the other uses it too.
|
||||
ThemeIconOverride? operator [](ThemeIconSlot slot) {
|
||||
final partner = slot.partner;
|
||||
return overrides[slot.key] ??
|
||||
(partner == null ? null : overrides[partner.key]);
|
||||
}
|
||||
|
||||
/// Whether any of [slots] is replaced by a picture (drawn larger).
|
||||
bool hasPictureFor(Iterable<ThemeIconSlot> slots) => slots.any((slot) {
|
||||
final o = this[slot];
|
||||
return o?.imageBytes != null || o?.asset != null;
|
||||
});
|
||||
|
||||
@override
|
||||
MeshIconTheme copyWith({Map<String, ThemeIconOverride>? overrides}) =>
|
||||
MeshIconTheme(overrides ?? this.overrides);
|
||||
|
||||
@override
|
||||
MeshIconTheme lerp(MeshIconTheme? other, double t) =>
|
||||
t < 0.5 ? this : (other ?? this);
|
||||
}
|
||||
|
||||
/// Shows the active theme's icon or picture for [slot], or the default icon.
|
||||
///
|
||||
/// Named icons take [color] / the ambient [IconTheme] like a normal [Icon];
|
||||
/// pictures are drawn in their own colors at the same size.
|
||||
class ThemedIcon extends StatelessWidget {
|
||||
final ThemeIconSlot slot;
|
||||
final bool selected;
|
||||
final double? size;
|
||||
final Color? color;
|
||||
|
||||
/// Explicit replacement, bypassing the theme (used for editor previews).
|
||||
final ThemeIconOverride? forced;
|
||||
final bool useForced;
|
||||
|
||||
const ThemedIcon(
|
||||
this.slot, {
|
||||
super.key,
|
||||
this.selected = false,
|
||||
this.size,
|
||||
this.color,
|
||||
}) : forced = null,
|
||||
useForced = false;
|
||||
|
||||
const ThemedIcon.preview(
|
||||
this.slot,
|
||||
this.forced, {
|
||||
super.key,
|
||||
this.size,
|
||||
this.color,
|
||||
}) : selected = false,
|
||||
useForced = true;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final effective = useForced ? forced : MeshIconTheme.of(context)[slot];
|
||||
final bytes = effective?.imageBytes;
|
||||
final asset = effective?.asset;
|
||||
if (bytes != null || asset != null) {
|
||||
// Pictures are usually round badges with a rim, so at plain icon size
|
||||
// their detail is too small to make out. Draw them well above it.
|
||||
final side =
|
||||
(size ?? IconTheme.of(context).size ?? 24) * kThemePictureIconScale;
|
||||
return SizedBox.square(
|
||||
dimension: side,
|
||||
child: Image(
|
||||
image: bytes != null
|
||||
? themePictureProvider(bytes)
|
||||
: JxlImageProvider.asset(asset!),
|
||||
fit: BoxFit.contain,
|
||||
gaplessPlayback: true,
|
||||
filterQuality: FilterQuality.medium,
|
||||
errorBuilder: (_, _, _) => Icon(slot.icon, size: side, color: color),
|
||||
),
|
||||
);
|
||||
}
|
||||
final named = effective?.icon == null
|
||||
? null
|
||||
: kThemeIconCatalog[effective!.icon];
|
||||
return Icon(
|
||||
named ?? (selected ? slot.selectedIcon : slot.icon),
|
||||
size: size,
|
||||
color: color,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// How much larger than a plain icon a picture icon is drawn.
|
||||
const double kThemePictureIconScale = 1.6;
|
||||
|
||||
/// Largest side, in pixels, of a picture stored in a theme. Small enough to
|
||||
/// keep themes and share codes light, big enough for high-DPI icons.
|
||||
const int kThemeIconImageMaxSide = 128;
|
||||
|
||||
/// Decodes any common image format and re-encodes it as lossless JPEG XL
|
||||
/// (which keeps transparency) no larger than [kThemeIconImageMaxSide] on its
|
||||
/// longest side. Returns null when [bytes] is not a readable image.
|
||||
Future<Uint8List?> shrinkThemeIconImage(Uint8List bytes) async {
|
||||
try {
|
||||
final buffer = await ui.ImmutableBuffer.fromUint8List(bytes);
|
||||
final codec = await ui.instantiateImageCodecWithSize(
|
||||
buffer,
|
||||
getTargetSize: (width, height) {
|
||||
final longest = width > height ? width : height;
|
||||
if (longest <= kThemeIconImageMaxSide) {
|
||||
return ui.TargetImageSize(width: width, height: height);
|
||||
}
|
||||
final scale = kThemeIconImageMaxSide / longest;
|
||||
return ui.TargetImageSize(
|
||||
width: (width * scale).round().clamp(1, kThemeIconImageMaxSide),
|
||||
height: (height * scale).round().clamp(1, kThemeIconImageMaxSide),
|
||||
);
|
||||
},
|
||||
);
|
||||
final frame = await codec.getNextFrame();
|
||||
codec.dispose();
|
||||
try {
|
||||
return await encodeJxlFromUiImage(frame.image);
|
||||
} finally {
|
||||
frame.image.dispose();
|
||||
}
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui' show Rect;
|
||||
|
||||
import 'package:file_selector/file_selector.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import '../models/custom_theme.dart';
|
||||
import 'platform_info.dart';
|
||||
|
||||
/// File extension for exported themes: JSON Lines, one theme per line, each
|
||||
/// line the same JSON as a theme's share code.
|
||||
const String kThemeFileExtension = 'jsonl';
|
||||
|
||||
const _typeGroup = XTypeGroup(
|
||||
label: 'MeshCore themes',
|
||||
extensions: [kThemeFileExtension, 'json', 'txt'],
|
||||
mimeTypes: [
|
||||
'application/jsonl',
|
||||
'application/x-ndjson',
|
||||
'application/json',
|
||||
'text/plain',
|
||||
'application/octet-stream',
|
||||
],
|
||||
uniformTypeIdentifiers: ['public.json', 'public.plain-text', 'public.data'],
|
||||
);
|
||||
|
||||
/// One theme per line, newline-terminated.
|
||||
String encodeThemesJsonl(Iterable<CustomTheme> themes) {
|
||||
final buffer = StringBuffer();
|
||||
for (final theme in themes) {
|
||||
buffer.writeln(theme.toShareCode());
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/// Reads every valid theme in [text], giving each a fresh ID from [newId].
|
||||
///
|
||||
/// Accepts JSON Lines (blank and invalid lines are skipped), and for
|
||||
/// convenience a single theme object spread over several lines, as a
|
||||
/// hand-edited or pretty-printed file would be.
|
||||
List<CustomTheme> decodeThemesJsonl(
|
||||
String text, {
|
||||
required String Function() newId,
|
||||
}) {
|
||||
final themes = <CustomTheme>[];
|
||||
for (final line in const LineSplitter().convert(text)) {
|
||||
if (line.trim().isEmpty) continue;
|
||||
final theme = CustomTheme.fromShareCode(line, newId: newId());
|
||||
if (theme != null) themes.add(theme);
|
||||
}
|
||||
if (themes.isEmpty) {
|
||||
final whole = CustomTheme.fromShareCode(text, newId: newId());
|
||||
if (whole != null) themes.add(whole);
|
||||
}
|
||||
return themes;
|
||||
}
|
||||
|
||||
/// A safe file name stem for [name] (letters, digits, dashes).
|
||||
String themeFileStem(String name) {
|
||||
final stem = name
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replaceAll(RegExp(r'[^a-z0-9]+'), '-')
|
||||
.replaceAll(RegExp(r'^-+|-+$'), '');
|
||||
return stem.isEmpty ? 'theme' : stem;
|
||||
}
|
||||
|
||||
enum ThemeFileResult { saved, cancelled, failed }
|
||||
|
||||
/// Saves [themes] as a `.jsonl` file: a save dialog on desktop, a download
|
||||
/// on web, and the share sheet on phones (which have no save dialog).
|
||||
Future<ThemeFileResult> exportThemesFile(
|
||||
List<CustomTheme> themes, {
|
||||
required String fileStem,
|
||||
Rect? sharePositionOrigin,
|
||||
}) async {
|
||||
final fileName = '$fileStem.$kThemeFileExtension';
|
||||
final bytes = Uint8List.fromList(utf8.encode(encodeThemesJsonl(themes)));
|
||||
final file = XFile.fromData(
|
||||
bytes,
|
||||
name: fileName,
|
||||
mimeType: 'application/jsonl',
|
||||
);
|
||||
try {
|
||||
if (PlatformInfo.isWeb) {
|
||||
await file.saveTo(fileName);
|
||||
return ThemeFileResult.saved;
|
||||
}
|
||||
if (PlatformInfo.isDesktop) {
|
||||
final location = await getSaveLocation(
|
||||
suggestedName: fileName,
|
||||
acceptedTypeGroups: const [_typeGroup],
|
||||
);
|
||||
if (location == null) return ThemeFileResult.cancelled;
|
||||
await file.saveTo(location.path);
|
||||
return ThemeFileResult.saved;
|
||||
}
|
||||
final result = await SharePlus.instance.share(
|
||||
ShareParams(
|
||||
files: [file],
|
||||
fileNameOverrides: [fileName],
|
||||
sharePositionOrigin: sharePositionOrigin,
|
||||
),
|
||||
);
|
||||
return result.status == ShareResultStatus.dismissed
|
||||
? ThemeFileResult.cancelled
|
||||
: ThemeFileResult.saved;
|
||||
} catch (_) {
|
||||
return ThemeFileResult.failed;
|
||||
}
|
||||
}
|
||||
|
||||
/// Lets the user pick a theme file and returns its text, or null when they
|
||||
/// cancel. Throws when the file cannot be read.
|
||||
Future<String?> pickThemesFile() async {
|
||||
final file = await openFile(acceptedTypeGroups: const [_typeGroup]);
|
||||
if (file == null) return null;
|
||||
return utf8.decode(await file.readAsBytes(), allowMalformed: true);
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:koni_jxl_flutter/koni_jxl_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../helpers/snack_bar_builder.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../models/chat_background.dart';
|
||||
import '../services/chat_background_service.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
|
||||
/// Colors offered for chat backgrounds. Shown faded toward the theme's
|
||||
/// background, so they work in light and dark themes alike.
|
||||
const List<Color> kChatBackgroundColors = [
|
||||
Color(0xFF0F766E),
|
||||
Color(0xFF1E3A8A),
|
||||
Color(0xFF6B21A8),
|
||||
Color(0xFF9F1239),
|
||||
Color(0xFF166534),
|
||||
Color(0xFF78350F),
|
||||
Color(0xFF334155),
|
||||
Color(0xFF000000),
|
||||
Color(0xFFFFFFFF),
|
||||
Color(0xFFE7D8B8),
|
||||
Color(0xFFBAE6FD),
|
||||
Color(0xFFFBCFE8),
|
||||
];
|
||||
|
||||
/// Fade new color backgrounds start with: softer than pictures, which need
|
||||
/// to stay recognizable.
|
||||
const double kChatBackgroundColorFade = 0.6;
|
||||
|
||||
ChatBackgroundService? _maybeService(
|
||||
BuildContext context, {
|
||||
bool listen = true,
|
||||
}) {
|
||||
try {
|
||||
return Provider.of<ChatBackgroundService>(context, listen: listen);
|
||||
} on ProviderNotFoundException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// Draws [chatKey]'s background (its own, or the theme's) behind [child].
|
||||
class ChatBackdrop extends StatelessWidget {
|
||||
final String chatKey;
|
||||
final Widget child;
|
||||
|
||||
const ChatBackdrop({super.key, required this.chatKey, required this.child});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final background = _maybeService(context)?.resolve(chatKey);
|
||||
if (background == null) return child;
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Positioned.fill(child: ChatBackgroundLayer(background: background)),
|
||||
child,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Paints one [ChatBackground], faded toward the theme's surface color.
|
||||
class ChatBackgroundLayer extends StatelessWidget {
|
||||
final ChatBackground background;
|
||||
|
||||
const ChatBackgroundLayer({super.key, required this.background});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final surface = Theme.of(context).colorScheme.surface;
|
||||
final color = background.color;
|
||||
if (color != null) {
|
||||
return ColoredBox(color: Color.lerp(color, surface, background.fade)!);
|
||||
}
|
||||
final id = background.imageId;
|
||||
final asset = background.asset;
|
||||
final bytes =
|
||||
background.inlineImage ??
|
||||
(id == null ? null : _maybeService(context)?.imageBytes(id));
|
||||
if (bytes == null && asset == null) return ColoredBox(color: surface);
|
||||
return ExcludeSemantics(
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Image(
|
||||
// The service caches one Uint8List per picture, and the provider
|
||||
// keys on that instance, so rebuilds reuse the decoded image.
|
||||
image: bytes != null
|
||||
? JxlImageProvider.memory(bytes)
|
||||
: JxlImageProvider.asset(asset!),
|
||||
fit: BoxFit.cover,
|
||||
gaplessPlayback: true,
|
||||
errorBuilder: (_, _, _) => ColoredBox(color: surface),
|
||||
),
|
||||
ColoredBox(color: surface.withValues(alpha: background.fade)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Choose none, a color or a picture, and how faded it is.
|
||||
class ChatBackgroundPicker extends StatefulWidget {
|
||||
final ChatBackground? value;
|
||||
final ValueChanged<ChatBackground?> onChanged;
|
||||
|
||||
const ChatBackgroundPicker({
|
||||
super.key,
|
||||
required this.value,
|
||||
required this.onChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
State<ChatBackgroundPicker> createState() => _ChatBackgroundPickerState();
|
||||
}
|
||||
|
||||
class _ChatBackgroundPickerState extends State<ChatBackgroundPicker> {
|
||||
bool _busy = false;
|
||||
|
||||
Future<void> _pickPicture() async {
|
||||
final service = _maybeService(context, listen: false);
|
||||
if (service == null) return;
|
||||
setState(() => _busy = true);
|
||||
try {
|
||||
final file = await ImagePicker().pickImage(
|
||||
source: ImageSource.gallery,
|
||||
maxWidth: 2000,
|
||||
maxHeight: 2000,
|
||||
imageQuality: 92,
|
||||
);
|
||||
if (file == null) return;
|
||||
final id = await service.addImage(await file.readAsBytes());
|
||||
if (!mounted) return;
|
||||
if (id == null) {
|
||||
_showError();
|
||||
return;
|
||||
}
|
||||
widget.onChanged(ChatBackground.image(id));
|
||||
} catch (_) {
|
||||
if (mounted) _showError();
|
||||
} finally {
|
||||
if (mounted) setState(() => _busy = false);
|
||||
}
|
||||
}
|
||||
|
||||
void _showError() {
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.chatBackground_pictureFailed),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final value = widget.value;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
_Choice(
|
||||
selected: value == null,
|
||||
label: l10n.chatBackground_none,
|
||||
onTap: () => widget.onChanged(null),
|
||||
child: Icon(Icons.block, color: scheme.onSurfaceVariant),
|
||||
),
|
||||
for (final color in kChatBackgroundColors)
|
||||
_Choice(
|
||||
selected: value?.color == color,
|
||||
label: colorLabel(color),
|
||||
onTap: () => widget.onChanged(
|
||||
ChatBackground.color(
|
||||
color,
|
||||
fade: value?.color != null
|
||||
? value!.fade
|
||||
: kChatBackgroundColorFade,
|
||||
),
|
||||
),
|
||||
child: ChatBackgroundLayer(
|
||||
background: ChatBackground.color(
|
||||
color,
|
||||
fade: kChatBackgroundColorFade,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (value?.isImage ?? false)
|
||||
_Choice(
|
||||
selected: true,
|
||||
label: l10n.chatBackground_picture,
|
||||
onTap: _pickPicture,
|
||||
child: ChatBackgroundLayer(background: value!),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
OutlinedButton.icon(
|
||||
onPressed: _busy ? null : _pickPicture,
|
||||
icon: _busy
|
||||
? const SizedBox.square(
|
||||
dimension: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.image_outlined),
|
||||
label: Text(l10n.chatBackground_choosePicture),
|
||||
),
|
||||
if (value != null) ...[
|
||||
const SizedBox(height: 14),
|
||||
Text(
|
||||
l10n.chatBackground_fade,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
Slider(
|
||||
value: value.fade,
|
||||
min: ChatBackground.minFade,
|
||||
max: ChatBackground.maxFade,
|
||||
divisions: 8,
|
||||
label: '${(value.fade * 100).round()}%',
|
||||
onChanged: (fade) => widget.onChanged(value.withFade(fade)),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
static String colorLabel(Color color) {
|
||||
final rgb = color.toARGB32() & 0xFFFFFF;
|
||||
return '#${rgb.toRadixString(16).padLeft(6, '0').toUpperCase()}';
|
||||
}
|
||||
}
|
||||
|
||||
class _Choice extends StatelessWidget {
|
||||
final bool selected;
|
||||
final String label;
|
||||
final VoidCallback onTap;
|
||||
final Widget child;
|
||||
|
||||
const _Choice({
|
||||
required this.selected,
|
||||
required this.label,
|
||||
required this.onTap,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Semantics(
|
||||
button: true,
|
||||
selected: selected,
|
||||
label: label,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.sm),
|
||||
child: Container(
|
||||
width: 52,
|
||||
height: 52,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surface,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.sm),
|
||||
border: Border.all(
|
||||
color: selected ? scheme.primary : scheme.outline,
|
||||
width: selected ? 3 : 1,
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
child,
|
||||
if (selected)
|
||||
Center(child: Icon(Icons.check_circle, color: scheme.primary)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Bottom sheet for one chat's own background. Changes apply live, so the
|
||||
/// chat behind the sheet shows the result.
|
||||
Future<void> showChatBackgroundSheet(BuildContext context, String chatKey) {
|
||||
return showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
showDragHandle: true,
|
||||
builder: (sheetContext) => Consumer<ChatBackgroundService>(
|
||||
builder: (sheetContext, service, _) {
|
||||
final l10n = sheetContext.l10n;
|
||||
final overriding = service.overridingTheme;
|
||||
return SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 24),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
l10n.chatBackground_title,
|
||||
style: Theme.of(sheetContext).textTheme.titleLarge,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
l10n.chatBackground_thisChatOnly,
|
||||
style: Theme.of(sheetContext).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(sheetContext).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
if (overriding != null) ...[
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.info_outline,
|
||||
color: Theme.of(sheetContext).colorScheme.tertiary,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
l10n.chatBackground_themeOverrides(overriding.name),
|
||||
style: Theme.of(sheetContext).textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 16),
|
||||
ChatBackgroundPicker(
|
||||
value: service.chatBackground(chatKey),
|
||||
onChanged: (value) =>
|
||||
service.setChatBackground(chatKey, value),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import 'gif_message.dart';
|
||||
import 'gif_picker.dart';
|
||||
import 'mesh_ui.dart';
|
||||
import 'message_translation_button.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
/// One entry of the composer's "+" menu.
|
||||
@immutable
|
||||
@@ -186,7 +187,7 @@ class ChatComposer extends StatelessWidget {
|
||||
builder: (context, value, _) {
|
||||
final hasText = value.text.trim().isNotEmpty;
|
||||
return IconButton.filled(
|
||||
icon: const Icon(Icons.send, size: 20),
|
||||
icon: const ThemedIcon(ThemeIconSlot.send, size: 20),
|
||||
tooltip: sendTooltip,
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: hasText
|
||||
|
||||
@@ -4,6 +4,7 @@ import '../connector/meshcore_protocol.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../models/contact.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
/// Shared node-type visuals and last-seen formatting for contact lists
|
||||
/// (contacts, discovery, nearby-node scan).
|
||||
@@ -25,16 +26,16 @@ Color contactTypeColor(int type) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Node-type avatar icon. Returns null for chat nodes so [AvatarCircle]
|
||||
/// shows initials.
|
||||
IconData? contactTypeIcon(int type) {
|
||||
/// Node-type avatar icon slot (themes can replace these). Returns null for
|
||||
/// chat nodes so [AvatarCircle] shows initials.
|
||||
ThemeIconSlot? contactTypeIconSlot(int type) {
|
||||
switch (type) {
|
||||
case advTypeRepeater:
|
||||
return Icons.cell_tower;
|
||||
return ThemeIconSlot.repeater;
|
||||
case advTypeRoom:
|
||||
return Icons.meeting_room;
|
||||
return ThemeIconSlot.room;
|
||||
case advTypeSensor:
|
||||
return Icons.sensors;
|
||||
return ThemeIconSlot.sensor;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,655 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../helpers/holiday_triggers.dart';
|
||||
import '../services/app_settings_service.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
|
||||
/// How long each holiday animation runs.
|
||||
Duration holidayAnimationDuration(HolidayAnimation animation) =>
|
||||
switch (animation) {
|
||||
HolidayAnimation.halloween => const Duration(milliseconds: 4200),
|
||||
HolidayAnimation.thanksgiving => const Duration(milliseconds: 4800),
|
||||
HolidayAnimation.christmas => const Duration(milliseconds: 5200),
|
||||
HolidayAnimation.newYear => const Duration(milliseconds: 5600),
|
||||
};
|
||||
|
||||
/// Plays [animation] over the whole screen, starting from [origin] (global
|
||||
/// coordinates of the message it came from). Touches pass through, and the
|
||||
/// overlay removes itself when done.
|
||||
///
|
||||
/// Skipped when the user turned holiday animations off or the platform asks
|
||||
/// for reduced motion.
|
||||
void playHolidayAnimation(
|
||||
BuildContext context,
|
||||
HolidayAnimation animation, {
|
||||
required Offset origin,
|
||||
}) {
|
||||
final settings = context.read<AppSettingsService>().settings;
|
||||
if (!settings.holidayAnimationsEnabled) return;
|
||||
if (MediaQuery.maybeDisableAnimationsOf(context) ?? false) return;
|
||||
final overlay = Overlay.maybeOf(context, rootOverlay: true);
|
||||
if (overlay == null) return;
|
||||
late final OverlayEntry entry;
|
||||
entry = OverlayEntry(
|
||||
builder: (_) => HolidayAnimationView(
|
||||
animation: animation,
|
||||
origin: origin,
|
||||
onDone: () => entry.remove(),
|
||||
),
|
||||
);
|
||||
overlay.insert(entry);
|
||||
}
|
||||
|
||||
/// Watches a chat's newest message and plays its holiday animation when a
|
||||
/// new triggering message arrives. Messages already there when the chat
|
||||
/// opens never play, and each message plays at most once.
|
||||
class HolidayTriggerWatcher {
|
||||
String? _newestId;
|
||||
bool _primed = false;
|
||||
|
||||
/// Messages older than this when first seen (e.g. synced backlog) stay
|
||||
/// quiet.
|
||||
static const freshness = Duration(minutes: 2);
|
||||
|
||||
/// Call on every build with the chat's newest message. [originOf] gives
|
||||
/// the global point the animation starts from, once the frame is laid
|
||||
/// out.
|
||||
void onNewest(
|
||||
BuildContext context, {
|
||||
required String? id,
|
||||
required Iterable<String?> texts,
|
||||
required DateTime? receivedAt,
|
||||
required Offset? Function() originOf,
|
||||
}) {
|
||||
if (!_primed) {
|
||||
_primed = true;
|
||||
_newestId = id;
|
||||
return;
|
||||
}
|
||||
if (id == null || id == _newestId) return;
|
||||
_newestId = id;
|
||||
if (receivedAt == null ||
|
||||
DateTime.now().difference(receivedAt).abs() > freshness) {
|
||||
return;
|
||||
}
|
||||
HolidayAnimation? animation;
|
||||
for (final text in texts) {
|
||||
if (text == null) continue;
|
||||
animation = holidayAnimationFor(text);
|
||||
if (animation != null) break;
|
||||
}
|
||||
if (animation == null) return;
|
||||
final found = animation;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!context.mounted) return;
|
||||
final origin = originOf();
|
||||
if (origin == null) return;
|
||||
playHolidayAnimation(context, found, origin: origin);
|
||||
});
|
||||
// Normally called mid-build, but make sure a frame follows either way.
|
||||
WidgetsBinding.instance.ensureVisualUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
/// The global point a chat's newest message sits at: the bottom of the
|
||||
/// message list, on the sender's side.
|
||||
Offset? newestMessageOrigin(GlobalKey listKey, {required bool isOutgoing}) {
|
||||
final box = listKey.currentContext?.findRenderObject() as RenderBox?;
|
||||
if (box == null || !box.hasSize) return null;
|
||||
final local = Offset(
|
||||
isOutgoing ? box.size.width - 72 : 72,
|
||||
box.size.height - 48,
|
||||
);
|
||||
return box.localToGlobal(local);
|
||||
}
|
||||
|
||||
class HolidayAnimationView extends StatefulWidget {
|
||||
final HolidayAnimation animation;
|
||||
final Offset origin;
|
||||
final VoidCallback onDone;
|
||||
|
||||
const HolidayAnimationView({
|
||||
super.key,
|
||||
required this.animation,
|
||||
required this.origin,
|
||||
required this.onDone,
|
||||
});
|
||||
|
||||
@override
|
||||
State<HolidayAnimationView> createState() => _HolidayAnimationViewState();
|
||||
}
|
||||
|
||||
class _HolidayAnimationViewState extends State<HolidayAnimationView>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final AnimationController _controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: holidayAnimationDuration(widget.animation),
|
||||
);
|
||||
// Fixed seed per play keeps a run smooth; a new seed each play keeps it
|
||||
// from looking canned.
|
||||
late final int _seed = DateTime.now().microsecondsSinceEpoch;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller.forward().whenComplete(widget.onDone);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// The overlay sits above the app's Material, so without one of its own
|
||||
// every emoji Text gets Flutter's yellow "missing Material" underline.
|
||||
return IgnorePointer(
|
||||
child: ExcludeSemantics(
|
||||
child: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final size = constraints.biggest;
|
||||
// Played in the root overlay, which covers the whole screen
|
||||
// from its top-left, so global coordinates are local ones.
|
||||
// (Converting here would read parents not yet laid out.)
|
||||
final origin = Offset(
|
||||
widget.origin.dx.clamp(0, size.width).toDouble(),
|
||||
widget.origin.dy.clamp(0, size.height).toDouble(),
|
||||
);
|
||||
return AnimatedBuilder(
|
||||
animation: _controller,
|
||||
builder: (context, _) {
|
||||
final t = _controller.value;
|
||||
return switch (widget.animation) {
|
||||
HolidayAnimation.halloween => _Bats(
|
||||
t: t,
|
||||
size: size,
|
||||
origin: origin,
|
||||
seed: _seed,
|
||||
),
|
||||
HolidayAnimation.thanksgiving => _Turkey(
|
||||
t: t,
|
||||
size: size,
|
||||
seed: _seed,
|
||||
),
|
||||
HolidayAnimation.christmas => _Santa(
|
||||
t: t,
|
||||
size: size,
|
||||
seed: _seed,
|
||||
),
|
||||
HolidayAnimation.newYear => CustomPaint(
|
||||
size: size,
|
||||
painter: _FireworksPainter(t: t, seed: _seed),
|
||||
),
|
||||
};
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// An emoji glyph placed by its center.
|
||||
Widget _sprite(
|
||||
String emoji, {
|
||||
required Offset at,
|
||||
required double size,
|
||||
double opacity = 1,
|
||||
double rotation = 0,
|
||||
bool flip = false,
|
||||
double scaleY = 1,
|
||||
}) {
|
||||
return Positioned(
|
||||
left: at.dx - size / 2,
|
||||
top: at.dy - size / 2,
|
||||
child: Opacity(
|
||||
opacity: opacity.clamp(0, 1).toDouble(),
|
||||
child: Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: Matrix4.identity()
|
||||
..rotateZ(rotation)
|
||||
..scaleByDouble(flip ? -1.0 : 1.0, scaleY, 1, 1),
|
||||
child: SizedBox.square(
|
||||
dimension: size,
|
||||
child: Center(
|
||||
child: Text(
|
||||
emoji,
|
||||
style: MeshTheme.emoji(fontSize: size * 0.8),
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Drops sprites that are invisible or entirely off-screen (e.g. the sleigh
|
||||
/// before it flies in), and empty placeholders, so each frame only lays out
|
||||
/// what can be seen.
|
||||
List<Widget> _onScreen(Size size, List<Widget> children) {
|
||||
const margin = 160.0;
|
||||
bool hidden(Widget child) {
|
||||
if (child is! Positioned) return child is SizedBox && child.width == 0;
|
||||
final left = child.left, top = child.top;
|
||||
if (left != null &&
|
||||
top != null &&
|
||||
(left > size.width + margin ||
|
||||
top > size.height + margin ||
|
||||
left < -margin * 2 ||
|
||||
top < -margin * 2)) {
|
||||
return true;
|
||||
}
|
||||
final inner = child.child;
|
||||
return inner is Opacity && inner.opacity <= 0;
|
||||
}
|
||||
|
||||
return [
|
||||
for (final child in children)
|
||||
if (!hidden(child)) child,
|
||||
];
|
||||
}
|
||||
|
||||
double _fadeOut(double t, {double from = 0.75}) =>
|
||||
t < from ? 1 : 1 - (t - from) / (1 - from);
|
||||
|
||||
/// 0 → 1 → 0 over the run: in quickly, hold, out slowly.
|
||||
double _envelope(double t, {double rise = 0.12, double fall = 0.3}) {
|
||||
if (t < rise) return t / rise;
|
||||
if (t > 1 - fall) return (1 - t) / fall;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/// Full-screen wash of [color], e.g. Halloween dusk or a firework flash.
|
||||
Widget _wash(Color color, double opacity) => Positioned.fill(
|
||||
child: ColoredBox(color: color.withValues(alpha: opacity.clamp(0, 1))),
|
||||
);
|
||||
|
||||
/// Halloween: the screen dims to a purple dusk and a swarm of bats bursts
|
||||
/// out of the message, flapping off in every direction.
|
||||
class _Bats extends StatelessWidget {
|
||||
final double t;
|
||||
final Size size;
|
||||
final Offset origin;
|
||||
final int seed;
|
||||
|
||||
const _Bats({
|
||||
required this.t,
|
||||
required this.size,
|
||||
required this.origin,
|
||||
required this.seed,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final rand = math.Random(seed);
|
||||
final reach = size.longestSide * 1.3;
|
||||
final dusk = _envelope(t, rise: 0.1, fall: 0.35);
|
||||
// Expand: the scene must fill the screen whatever its children are
|
||||
// (a lone zero-size child would otherwise shrink it to nothing).
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: _onScreen(size, [
|
||||
_wash(const Color(0xFF14002A), 0.45 * dusk),
|
||||
// A moon peeks in at the top corner.
|
||||
_sprite(
|
||||
'🌕',
|
||||
at: Offset(size.width - 70, 90 - (1 - dusk) * 60),
|
||||
size: 110,
|
||||
opacity: 0.9 * dusk,
|
||||
),
|
||||
for (var i = 0; i < 46; i++)
|
||||
() {
|
||||
// Mostly upward, but the swarm fans out wide.
|
||||
final angle =
|
||||
-math.pi / 2 + (rand.nextDouble() - 0.5) * math.pi * 1.6;
|
||||
final speed = 0.5 + rand.nextDouble() * 0.8;
|
||||
final delay = rand.nextDouble() * 0.35;
|
||||
final wobble = 20 + rand.nextDouble() * 40;
|
||||
final phase = rand.nextDouble() * math.pi * 2;
|
||||
final batSize = 34 + rand.nextDouble() * 46;
|
||||
final local = ((t - delay) / (1 - delay)).clamp(0.0, 1.0);
|
||||
final eased = Curves.easeIn.transform(local);
|
||||
final distance = eased * reach * speed;
|
||||
final dir = Offset(math.cos(angle), math.sin(angle));
|
||||
final side = Offset(-dir.dy, dir.dx);
|
||||
final at =
|
||||
origin +
|
||||
dir * distance +
|
||||
side * math.sin(local * 14 + phase) * wobble;
|
||||
return _sprite(
|
||||
'🦇',
|
||||
at: at,
|
||||
size: batSize * (0.4 + 0.6 * math.min(1, local * 5)),
|
||||
opacity: local == 0 ? 0 : _fadeOut(local, from: 0.75),
|
||||
// Wing beat.
|
||||
scaleY: 0.55 + 0.45 * math.sin(local * 46 + phase).abs(),
|
||||
flip: dir.dx < 0,
|
||||
);
|
||||
}(),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Thanksgiving: a stampede of turkeys hops across the screen in a storm of
|
||||
/// autumn leaves.
|
||||
class _Turkey extends StatelessWidget {
|
||||
final double t;
|
||||
final Size size;
|
||||
final int seed;
|
||||
|
||||
const _Turkey({required this.t, required this.size, required this.seed});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final rand = math.Random(seed);
|
||||
final warm = _envelope(t, rise: 0.1, fall: 0.3);
|
||||
// (size, lane as a fraction of height, lag behind the leader, hop phase)
|
||||
const flock = [
|
||||
(130.0, 0.70, 0.00, 0.0),
|
||||
(86.0, 0.56, 0.10, 1.3),
|
||||
(96.0, 0.84, 0.17, 2.1),
|
||||
(70.0, 0.46, 0.26, 0.7),
|
||||
];
|
||||
final span = size.width + 320;
|
||||
// Expand: the scene must fill the screen whatever its children are
|
||||
// (a lone zero-size child would otherwise shrink it to nothing).
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: _onScreen(size, [
|
||||
_wash(const Color(0xFF5A2A00), 0.22 * warm),
|
||||
for (var i = 0; i < 44; i++)
|
||||
() {
|
||||
final startX = rand.nextDouble() * size.width * 1.2;
|
||||
final delay = rand.nextDouble() * 0.45;
|
||||
final fall = 0.5 + rand.nextDouble() * 0.6;
|
||||
final sway = 24 + rand.nextDouble() * 50;
|
||||
final leaf = ['🍂', '🍁', '🍂', '🌾'][rand.nextInt(4)];
|
||||
final leafSize = 26 + rand.nextDouble() * 26;
|
||||
final local = ((t - delay) / (1 - delay)).clamp(0.0, 1.0);
|
||||
return _sprite(
|
||||
leaf,
|
||||
at: Offset(
|
||||
startX + math.sin(local * 9 + i) * sway - local * 120,
|
||||
-40 + local * size.height * fall * 1.5,
|
||||
),
|
||||
size: leafSize,
|
||||
rotation: local * 8 + i,
|
||||
opacity: local == 0 ? 0 : _fadeOut(local),
|
||||
);
|
||||
}(),
|
||||
for (final (turkeySize, lane, lag, phase) in flock)
|
||||
...() {
|
||||
final p = ((t - lag) / (1 - lag)).clamp(0.0, 1.0);
|
||||
// Emoji turkeys face left, so they run right to left.
|
||||
final x = size.width + 160 - p * span;
|
||||
final ground = size.height * lane;
|
||||
final stride = math.sin(p * math.pi * 16 + phase).abs();
|
||||
return [
|
||||
for (var d = 1; d <= 3; d++)
|
||||
_sprite(
|
||||
'💨',
|
||||
at: Offset(
|
||||
x + turkeySize * 0.55 + d * turkeySize * 0.3,
|
||||
ground + turkeySize * 0.3,
|
||||
),
|
||||
size: turkeySize * (0.42 - d * 0.08),
|
||||
opacity: p == 0 ? 0 : (0.8 - d * 0.2) * stride,
|
||||
),
|
||||
_sprite(
|
||||
'🦃',
|
||||
at: Offset(x, ground - stride * turkeySize * 0.32),
|
||||
size: turkeySize,
|
||||
rotation: math.sin(p * math.pi * 16 + phase) * 0.12,
|
||||
),
|
||||
];
|
||||
}(),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Christmas: a blizzard rolls in while Santa's sleigh and a team of
|
||||
/// reindeer swoop across the sky, trailing sparkles and dropping presents.
|
||||
class _Santa extends StatelessWidget {
|
||||
final double t;
|
||||
final Size size;
|
||||
final int seed;
|
||||
|
||||
const _Santa({required this.t, required this.size, required this.seed});
|
||||
|
||||
static const _spacing = 58.0;
|
||||
static const _team = 4;
|
||||
|
||||
Offset _sleighAt(double p) {
|
||||
// Right to left (emoji reindeer face left), swooping low then up.
|
||||
final x = size.width + 360 - p * (size.width + 760);
|
||||
final y =
|
||||
size.height * 0.34 -
|
||||
math.sin(p * math.pi) * size.height * 0.2 +
|
||||
math.sin(p * math.pi * 3) * 18;
|
||||
return Offset(x, y);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final rand = math.Random(seed);
|
||||
final p = Curves.easeInOut.transform(t);
|
||||
final head = _sleighAt(p);
|
||||
final sleighOffset = Offset((_team + 0.7) * _spacing, 12);
|
||||
final night = _envelope(t, rise: 0.12, fall: 0.3);
|
||||
// Expand: the scene must fill the screen whatever its children are
|
||||
// (a lone zero-size child would otherwise shrink it to nothing).
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: _onScreen(size, [
|
||||
_wash(const Color(0xFF02142E), 0.4 * night),
|
||||
for (var i = 0; i < 60; i++)
|
||||
() {
|
||||
final x = rand.nextDouble() * size.width * 1.3;
|
||||
final delay = rand.nextDouble() * 0.5;
|
||||
final local = ((t - delay) / (1 - delay)).clamp(0.0, 1.0);
|
||||
return _sprite(
|
||||
'❄️',
|
||||
at: Offset(
|
||||
x + math.sin(local * 7 + i) * 26 - local * 140,
|
||||
-30 + local * size.height * 1.1,
|
||||
),
|
||||
size: 14 + rand.nextDouble() * 22,
|
||||
rotation: local * 4 + i,
|
||||
opacity: local == 0 ? 0 : 0.95 * _fadeOut(local),
|
||||
);
|
||||
}(),
|
||||
// Sparkle trail where the sleigh just was.
|
||||
for (var i = 1; i <= 26; i++)
|
||||
() {
|
||||
final back = (p - i * 0.018).clamp(0.0, 1.0);
|
||||
final at =
|
||||
_sleighAt(back) +
|
||||
sleighOffset +
|
||||
Offset(20, 8 + math.sin(i * 1.7) * 14 + i * 2.5);
|
||||
return _sprite(
|
||||
i.isEven ? '✨' : '⭐',
|
||||
at: at,
|
||||
size: 30 - i * 0.8,
|
||||
opacity: (1 - i / 27) * _fadeOut(t, from: 0.85),
|
||||
rotation: i * 0.6 + t * 6,
|
||||
);
|
||||
}(),
|
||||
// Presents tumbling out behind the sleigh.
|
||||
for (var g = 0; g < 5; g++)
|
||||
() {
|
||||
final drop = 0.18 + g * 0.13;
|
||||
final local = ((p - drop) / 0.35).clamp(0.0, 1.0);
|
||||
if (local == 0) return const SizedBox.shrink();
|
||||
final from = _sleighAt(drop) + sleighOffset;
|
||||
return _sprite(
|
||||
'🎁',
|
||||
at: from + Offset(local * 40, local * local * size.height * 0.7),
|
||||
size: 40,
|
||||
rotation: local * 5 * (g.isEven ? 1 : -1),
|
||||
opacity: _fadeOut(local, from: 0.7),
|
||||
);
|
||||
}(),
|
||||
for (var i = 0; i < _team; i++)
|
||||
_sprite(
|
||||
'🦌',
|
||||
at: head + Offset(i * _spacing, math.sin(t * 36 + i * 0.9) * 6),
|
||||
size: 62,
|
||||
),
|
||||
_sprite('🛷', at: head + sleighOffset, size: 80),
|
||||
_sprite('🎅', at: head + sleighOffset + const Offset(4, -30), size: 60),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// New Year: a barrage of rockets bursts into big double rings of colored
|
||||
/// sparks that crackle, with the screen flashing on each burst.
|
||||
class _FireworksPainter extends CustomPainter {
|
||||
final double t;
|
||||
final int seed;
|
||||
|
||||
_FireworksPainter({required this.t, required this.seed});
|
||||
|
||||
static const _colors = [
|
||||
Color(0xFFFFD54F),
|
||||
Color(0xFFFF5252),
|
||||
Color(0xFF40C4FF),
|
||||
Color(0xFF69F0AE),
|
||||
Color(0xFFFF80AB),
|
||||
Color(0xFFE040FB),
|
||||
Color(0xFFFFFFFF),
|
||||
];
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final rand = math.Random(seed);
|
||||
const bursts = 16;
|
||||
const rise = 0.12;
|
||||
const life = 0.36;
|
||||
|
||||
// Night sky behind the show.
|
||||
final sky = _envelope(t, rise: 0.08, fall: 0.25);
|
||||
canvas.drawRect(
|
||||
Offset.zero & size,
|
||||
Paint()..color = const Color(0xFF000814).withValues(alpha: 0.5 * sky),
|
||||
);
|
||||
|
||||
var flash = 0.0;
|
||||
for (var b = 0; b < bursts; b++) {
|
||||
final start = b * 0.038 + rand.nextDouble() * 0.04;
|
||||
final target = Offset(
|
||||
size.width * (0.08 + rand.nextDouble() * 0.84),
|
||||
size.height * (0.08 + rand.nextDouble() * 0.5),
|
||||
);
|
||||
final launch = Offset(
|
||||
target.dx + (rand.nextDouble() - 0.5) * 120,
|
||||
size.height + 10,
|
||||
);
|
||||
final color = _colors[rand.nextInt(_colors.length)];
|
||||
final inner = _colors[rand.nextInt(_colors.length)];
|
||||
final radius = 110 + rand.nextDouble() * 110;
|
||||
final sparks = 48 + rand.nextInt(24);
|
||||
final angles = [
|
||||
for (var i = 0; i < sparks; i++)
|
||||
i / sparks * math.pi * 2 + rand.nextDouble() * 0.15,
|
||||
];
|
||||
final glitter = [
|
||||
for (var i = 0; i < 24; i++)
|
||||
(rand.nextDouble() * math.pi * 2, rand.nextDouble()),
|
||||
];
|
||||
final local = t - start;
|
||||
if (local < 0) continue;
|
||||
|
||||
if (local < rise) {
|
||||
final p = Curves.easeOut.transform(local / rise);
|
||||
final at = Offset.lerp(launch, target, p)!;
|
||||
final tail = Offset.lerp(launch, target, math.max(0, p - 0.18))!;
|
||||
canvas.drawLine(
|
||||
tail,
|
||||
at,
|
||||
Paint()
|
||||
..shader = LinearGradient(
|
||||
colors: [color.withValues(alpha: 0), color],
|
||||
).createShader(Rect.fromPoints(tail, at))
|
||||
..strokeWidth = 4
|
||||
..strokeCap = StrokeCap.round,
|
||||
);
|
||||
canvas.drawCircle(at, 4, Paint()..color = Colors.white);
|
||||
continue;
|
||||
}
|
||||
|
||||
final p = ((local - rise) / life).clamp(0.0, 1.0);
|
||||
if (p >= 1) continue;
|
||||
if (p < 0.12) flash = math.max(flash, 1 - p / 0.12);
|
||||
final spread = Curves.easeOutCubic.transform(p) * radius;
|
||||
final gravity = p * p * 90;
|
||||
final alpha = 1 - p;
|
||||
|
||||
if (p < 0.2) {
|
||||
canvas.drawCircle(
|
||||
target,
|
||||
radius * 0.5 * (1 - p / 0.2),
|
||||
Paint()
|
||||
..color = Colors.white.withValues(alpha: 0.7 * (1 - p / 0.2))
|
||||
..maskFilter = const MaskFilter.blur(BlurStyle.normal, 26),
|
||||
);
|
||||
}
|
||||
// Outer ring with streaks, inner ring in a second color.
|
||||
for (final (ringColor, scale, dot) in [
|
||||
(color, 1.0, 3.0),
|
||||
(inner, 0.55, 2.4),
|
||||
]) {
|
||||
final spark = Paint()..color = ringColor.withValues(alpha: alpha);
|
||||
final glow = Paint()
|
||||
..color = ringColor.withValues(alpha: alpha * 0.45)
|
||||
..maskFilter = const MaskFilter.blur(BlurStyle.normal, 6);
|
||||
final streak = Paint()
|
||||
..color = ringColor.withValues(alpha: alpha * 0.6)
|
||||
..strokeWidth = dot * 0.8
|
||||
..strokeCap = StrokeCap.round;
|
||||
for (final a in angles) {
|
||||
final dir = Offset(math.cos(a), math.sin(a));
|
||||
final at = target + dir * spread * scale + Offset(0, gravity);
|
||||
final behind =
|
||||
target + dir * spread * scale * 0.82 + Offset(0, gravity * 0.8);
|
||||
canvas.drawLine(behind, at, streak);
|
||||
canvas.drawCircle(at, dot * 2.4 * (1 - p * 0.6), glow);
|
||||
canvas.drawCircle(at, dot * (1 - p * 0.5), spark);
|
||||
}
|
||||
}
|
||||
// Crackling glitter that twinkles as it falls.
|
||||
if (p > 0.35) {
|
||||
final twinkle = Paint()..color = Colors.white.withValues(alpha: alpha);
|
||||
for (final (a, r) in glitter) {
|
||||
if (math.sin((p * 60) + a * 10) < 0.2) continue;
|
||||
final at =
|
||||
target +
|
||||
Offset(math.cos(a), math.sin(a)) * radius * (0.3 + r * 0.8) +
|
||||
Offset(0, gravity * 1.3);
|
||||
canvas.drawCircle(at, 1.8, twinkle);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flash > 0) {
|
||||
canvas.drawRect(
|
||||
Offset.zero & size,
|
||||
Paint()..color = Colors.white.withValues(alpha: 0.18 * flash),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(_FireworksPainter old) => old.t != t || old.seed != seed;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
|
||||
|
||||
import '../l10n/l10n.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
/// MeshCore shared design kit.
|
||||
///
|
||||
@@ -283,12 +284,14 @@ class StatTile extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// Initials avatar with a deterministic per-name hue, or a fixed [color]
|
||||
/// for node-type coloring. Optional [icon] replaces initials.
|
||||
/// for node-type coloring. Optional [icon] or themeable [iconSlot] replaces
|
||||
/// initials.
|
||||
class AvatarCircle extends StatelessWidget {
|
||||
final String name;
|
||||
final double size;
|
||||
final Color? color;
|
||||
final IconData? icon;
|
||||
final ThemeIconSlot? iconSlot;
|
||||
|
||||
const AvatarCircle({
|
||||
super.key,
|
||||
@@ -296,6 +299,7 @@ class AvatarCircle extends StatelessWidget {
|
||||
this.size = 40,
|
||||
this.color,
|
||||
this.icon,
|
||||
this.iconSlot,
|
||||
});
|
||||
|
||||
static const _hues = [
|
||||
@@ -320,6 +324,29 @@ class AvatarCircle extends StatelessWidget {
|
||||
final accent = color ?? _colorFor(name);
|
||||
final initials = _initials(name);
|
||||
final background = _tintedCardBackground(context, accent, 0.14);
|
||||
// A theme picture (e.g. a holiday marker) fills the whole circle, the
|
||||
// same as on the map, rather than sitting small inside the tint.
|
||||
final picture = iconSlot == null
|
||||
? null
|
||||
: themePictureOf(MeshIconTheme.of(context)[iconSlot!]);
|
||||
if (picture != null) {
|
||||
return SizedBox.square(
|
||||
dimension: size,
|
||||
child: ClipOval(
|
||||
child: Image(
|
||||
image: picture,
|
||||
fit: BoxFit.cover,
|
||||
gaplessPlayback: true,
|
||||
filterQuality: FilterQuality.medium,
|
||||
errorBuilder: (_, _, _) => Icon(
|
||||
iconSlot!.icon,
|
||||
size: size * 0.5,
|
||||
color: readableAccent(accent, background, minContrast: 3),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container(
|
||||
width: size,
|
||||
height: size,
|
||||
@@ -329,7 +356,13 @@ class AvatarCircle extends StatelessWidget {
|
||||
border: Border.all(color: accent.withValues(alpha: 0.4)),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: icon != null
|
||||
child: iconSlot != null
|
||||
? ThemedIcon(
|
||||
iconSlot!,
|
||||
size: size * 0.55,
|
||||
color: readableAccent(accent, background, minContrast: 3),
|
||||
)
|
||||
: icon != null
|
||||
? Icon(
|
||||
icon,
|
||||
size: size * 0.5,
|
||||
|
||||
@@ -17,28 +17,30 @@ class MessageBubbleColors {
|
||||
required this.meta,
|
||||
});
|
||||
|
||||
/// Outgoing bubbles use [MeshPalette.me] / [MeshPalette.meBorder] /
|
||||
/// [MeshPalette.meInk]; a failed send switches to the error container.
|
||||
/// Outgoing bubbles use the theme's [MeshBubbleTheme]; a failed send
|
||||
/// switches to the error container.
|
||||
factory MessageBubbleColors.of(
|
||||
ColorScheme scheme, {
|
||||
BuildContext context, {
|
||||
required bool isOutgoing,
|
||||
bool isFailed = false,
|
||||
}) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final bubble = MeshBubbleTheme.of(context);
|
||||
final text = isFailed
|
||||
? scheme.onErrorContainer
|
||||
: isOutgoing
|
||||
? MeshPalette.meInk
|
||||
? bubble.meInk
|
||||
: scheme.onSurface;
|
||||
return MessageBubbleColors(
|
||||
background: isFailed
|
||||
? scheme.errorContainer
|
||||
: isOutgoing
|
||||
? MeshPalette.me
|
||||
? bubble.me
|
||||
: scheme.surfaceContainerLow,
|
||||
border: isFailed
|
||||
? scheme.error
|
||||
: isOutgoing
|
||||
? MeshPalette.meBorder
|
||||
? bubble.meBorder
|
||||
: scheme.outlineVariant,
|
||||
text: text,
|
||||
meta: text.withValues(alpha: 0.65),
|
||||
@@ -109,7 +111,7 @@ class MessageBubbleFrame extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = MessageBubbleColors.of(
|
||||
Theme.of(context).colorScheme,
|
||||
context,
|
||||
isOutgoing: isOutgoing,
|
||||
isFailed: isFailed,
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ import '../theme/mesh_theme.dart';
|
||||
import 'mesh_ui.dart';
|
||||
import 'repeater_login_dialog.dart';
|
||||
import 'room_login_dialog.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
/// Map accent colour for a node type.
|
||||
Color mapNodeTypeColor(int type) {
|
||||
@@ -230,11 +231,17 @@ void showNodeInfoSheet(
|
||||
BottomSheetHeader(
|
||||
title: contact.name,
|
||||
subtitle: contact.typeLabel(l10n),
|
||||
trailing: Icon(
|
||||
mapNodeTypeIcon(contact.type),
|
||||
color: mapNodeTypeColor(contact.type),
|
||||
size: 20,
|
||||
),
|
||||
trailing: mapMarkerSlotForNodeType(contact.type) == null
|
||||
? Icon(
|
||||
mapNodeTypeIcon(contact.type),
|
||||
color: mapNodeTypeColor(contact.type),
|
||||
size: 20,
|
||||
)
|
||||
: ThemedIcon(
|
||||
mapMarkerSlotForNodeType(contact.type)!,
|
||||
color: mapNodeTypeColor(contact.type),
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
|
||||
@@ -193,7 +193,7 @@ class _NodeScanSheetState extends State<NodeScanSheet> {
|
||||
name: contact.name,
|
||||
size: 42,
|
||||
color: color,
|
||||
icon: contactTypeIcon(response.nodeType),
|
||||
iconSlot: contactTypeIconSlot(response.nodeType),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
@@ -221,7 +221,7 @@ class _NodeScanSheetState extends State<NodeScanSheet> {
|
||||
child: StatusChip(
|
||||
label: contact.typeLabel(l10n).toUpperCase(),
|
||||
color: color,
|
||||
icon: contactTypeIcon(response.nodeType),
|
||||
icon: contactTypeIconSlot(response.nodeType)?.icon,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
class QuickSwitchBar extends StatelessWidget {
|
||||
final int selectedIndex;
|
||||
@@ -25,6 +26,10 @@ class QuickSwitchBar extends StatelessWidget {
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = theme.colorScheme;
|
||||
final labelStyle = theme.textTheme.labelMedium ?? const TextStyle();
|
||||
// Custom themes style the bar on map screens like everywhere else; only
|
||||
// the stock theme uses the fixed high-contrast map palette.
|
||||
final highContrast =
|
||||
this.highContrast && !MeshMapTheme.of(context).followsTheme;
|
||||
final background = highContrast ? MapPalette.panelDark : Colors.transparent;
|
||||
// The selected icon sits on the primary indicator pill, so it uses
|
||||
// onPrimary. The label sits below on the bar background, so it must use a
|
||||
@@ -77,19 +82,28 @@ class QuickSwitchBar extends StatelessWidget {
|
||||
}),
|
||||
),
|
||||
child: NavigationBar(
|
||||
height: 60,
|
||||
// Picture icons are drawn larger than plain ones; give them
|
||||
// room above the labels.
|
||||
height:
|
||||
MeshIconTheme.of(context).hasPictureFor(const [
|
||||
ThemeIconSlot.contacts,
|
||||
ThemeIconSlot.channels,
|
||||
ThemeIconSlot.map,
|
||||
])
|
||||
? 76
|
||||
: 60,
|
||||
selectedIndex: selectedIndex,
|
||||
onDestinationSelected: onDestinationSelected,
|
||||
destinations: [
|
||||
NavigationDestination(
|
||||
icon: _buildIconWithBadge(
|
||||
context,
|
||||
const Icon(Icons.people_outline),
|
||||
const ThemedIcon(ThemeIconSlot.contacts),
|
||||
contactsUnreadCount,
|
||||
),
|
||||
selectedIcon: _buildIconWithBadge(
|
||||
context,
|
||||
const Icon(Icons.people),
|
||||
const ThemedIcon(ThemeIconSlot.contacts, selected: true),
|
||||
contactsUnreadCount,
|
||||
),
|
||||
label: context.l10n.nav_contacts,
|
||||
@@ -97,19 +111,22 @@ class QuickSwitchBar extends StatelessWidget {
|
||||
NavigationDestination(
|
||||
icon: _buildIconWithBadge(
|
||||
context,
|
||||
const Icon(Icons.tag),
|
||||
const ThemedIcon(ThemeIconSlot.channels),
|
||||
channelsUnreadCount,
|
||||
),
|
||||
selectedIcon: _buildIconWithBadge(
|
||||
context,
|
||||
const Icon(Icons.tag),
|
||||
const ThemedIcon(ThemeIconSlot.channels, selected: true),
|
||||
channelsUnreadCount,
|
||||
),
|
||||
label: context.l10n.nav_channels,
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.map_outlined),
|
||||
selectedIcon: const Icon(Icons.map),
|
||||
icon: const ThemedIcon(ThemeIconSlot.map),
|
||||
selectedIcon: const ThemedIcon(
|
||||
ThemeIconSlot.map,
|
||||
selected: true,
|
||||
),
|
||||
label: context.l10n.nav_map,
|
||||
),
|
||||
],
|
||||
@@ -121,7 +138,7 @@ class QuickSwitchBar extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildIconWithBadge(BuildContext context, Icon icon, int count) {
|
||||
Widget _buildIconWithBadge(BuildContext context, Widget icon, int count) {
|
||||
if (count <= 0) return icon;
|
||||
final label = count > 99 ? '99+' : '$count';
|
||||
return Badge(label: Text(label), child: icon);
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:meshcore_open/l10n/l10n.dart';
|
||||
import 'package:meshcore_open/screens/companion_radio_stats_screen.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../theme/mesh_theme.dart';
|
||||
import 'mesh_ui.dart';
|
||||
|
||||
void pushCompanionRadioStatsScreen(BuildContext context) {
|
||||
@@ -146,7 +145,7 @@ class AirActivityDotState extends State<AirActivityDot> {
|
||||
final on = widget.active && _blink;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return PulseDot(
|
||||
color: on ? MeshPalette.blue : scheme.outline,
|
||||
color: on ? scheme.primary : scheme.outline,
|
||||
size: 11,
|
||||
animate: false,
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ import '../theme/mesh_theme.dart';
|
||||
import 'mesh_ui.dart';
|
||||
import 'node_info_sheet.dart';
|
||||
import 'signal_ui.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
Contact? _getRepeaterPrefixMatchNearLocation(
|
||||
List<Contact> contacts,
|
||||
@@ -386,8 +387,8 @@ class _SNRIndicatorState extends State<SNRIndicator> {
|
||||
BottomSheetHeader(
|
||||
title: prefixLabel,
|
||||
subtitle: l10n.snrIndicator_unknownRepeater,
|
||||
trailing: Icon(
|
||||
mapNodeTypeIcon(advTypeRepeater),
|
||||
trailing: ThemedIcon(
|
||||
ThemeIconSlot.mapRepeater,
|
||||
color: mapNodeTypeColor(advTypeRepeater),
|
||||
size: 20,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user