Merge origin/dev into feat/group-editor-members-first

This commit is contained in:
zjs81 committed 2026-11-21 02:54:12 -07:00
commit 5e4e9bfce5
67 files changed
+5651 -1056

No files matched your search

+123 -67
View File
@@ -12,6 +12,7 @@ import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_
import '../utils/advert_signature.dart';
import '../models/channel.dart';
import '../models/channel_message.dart';
import '../models/chat_compression_mode.dart';
import '../models/bookmarked_message.dart';
import '../models/companion_radio_stats.dart';
import '../models/contact.dart';
@@ -61,6 +62,7 @@ import '../storage/channel_settings_store.dart';
import '../storage/channel_region_store.dart';
import '../storage/channel_storage_migration.dart';
import '../storage/channel_store.dart';
import '../storage/contact_added_at_store.dart';
import '../storage/contact_discovery_store.dart';
import '../storage/contact_settings_store.dart';
import '../storage/contact_store.dart';
@@ -525,6 +527,8 @@ class MeshCoreConnector extends ChangeNotifier {
final ChannelRegionStore _channelRegionStore = ChannelRegionStore();
final ContactSettingsStore _contactSettingsStore = ContactSettingsStore();
final ContactStore _contactStore = ContactStore();
final ContactAddedAtStore _contactAddedAtStore = ContactAddedAtStore();
final Map<String, DateTime> _contactAddedAt = {};
final ContactDiscoveryStore _discoveryContactStore = ContactDiscoveryStore();
final ChannelStore _channelStore = ChannelStore();
final UnreadStore _unreadStore = UnreadStore();
@@ -648,6 +652,11 @@ class MeshCoreConnector extends ChangeNotifier {
return radio.bleDisplayName;
}
/// Phone time a contact was first added from a card; the list orders by it
/// while the radio has no advert time for the contact.
DateTime? contactAddedAt(String contactPubKeyHex) =>
_contactAddedAt[contactPubKeyHex];
Contact? getContactByPubKeyHex(String contactPubKeyHex) {
return _contacts.cast<Contact?>().firstWhere(
(c) => c?.publicKeyHex == contactPubKeyHex,
@@ -1816,10 +1825,6 @@ class MeshCoreConnector extends ChangeNotifier {
await _channelRegionStore.saveDefaultRegion(region);
}
void ensureContactSmazSettingLoaded(String contactKeyHex) {
_ensureContactSmazSettingLoaded(contactKeyHex);
}
bool isChannelCyr2LatEnabled(int channelIndex) {
_ensureChannelCyr2LatSettingLoaded(channelIndex);
return _channelCyr2LatEnabled[channelIndex] ?? false;
@@ -1830,10 +1835,6 @@ class MeshCoreConnector extends ChangeNotifier {
return _contactCyr2LatEnabled[contactKeyHex] ?? false;
}
void ensureContactCyr2LatSettingLoaded(String contactKeyHex) {
_ensureContactCyr2LatSettingLoaded(contactKeyHex);
}
Future<void> loadUnreadState() async {
_contactUnreadCount
..clear()
@@ -2102,30 +2103,97 @@ class MeshCoreConnector extends ChangeNotifier {
];
}
Future<void> setChannelSmazEnabled(int channelIndex, bool enabled) async {
final slots = _slotsSharingChannel(channelIndex);
for (final slot in slots) {
_channelSmazEnabled[slot] = enabled;
ChatCompressionMode channelCompressionMode(int channelIndex) {
if (isChannelSmazEnabled(channelIndex)) return ChatCompressionMode.smaz;
if (isChannelCyr2LatEnabled(channelIndex)) {
return ChatCompressionMode.cyr2lat;
}
final channelId = _channelIdForSlot(channelIndex);
if (enabled) {
for (final slot in slots) {
_channelCyr2LatEnabled[slot] = false;
}
if (channelId != null) {
await _channelSettingsStore.saveCyr2LatEnabled(channelId, false);
}
}
if (channelId != null) {
await _channelSettingsStore.saveSmazEnabled(channelId, enabled);
}
notifyListeners();
return ChatCompressionMode.off;
}
Future<void> setContactSmazEnabled(String contactKeyHex, bool enabled) async {
_contactSmazEnabled[contactKeyHex] = enabled;
await _contactSettingsStore.saveSmazEnabled(contactKeyHex, enabled);
notifyListeners();
ChatCompressionMode contactCompressionMode(String contactKeyHex) {
_ensureContactSmazSettingLoaded(contactKeyHex);
if (isContactSmazEnabled(contactKeyHex)) return ChatCompressionMode.smaz;
if (isContactCyr2LatEnabled(contactKeyHex)) {
return ChatCompressionMode.cyr2lat;
}
return ChatCompressionMode.off;
}
/// Serializes compression writes so overlapping choices can't interleave
/// their flag writes and leave SMAZ and Cyr2Lat both on.
Future<void> _compressionWrites = Future<void>.value();
Future<void> _queueCompressionWrite(Future<void> Function() write) {
final next = _compressionWrites.then((_) => write());
_compressionWrites = next.catchError((_) {});
return next;
}
/// Saves [mode] for the channel in [channelIndex] and every slot holding
/// the same channel. Flags are switched off before the new one is switched
/// on, and memory follows each completed write, so a failure never leaves
/// both on. Throws [StateError] when the slot has no storage ID.
Future<void> setChannelCompressionMode(
int channelIndex,
ChatCompressionMode mode,
) {
return _queueCompressionWrite(() async {
final channelId = _channelIdForSlot(channelIndex);
if (channelId == null) {
throw StateError('Channel slot $channelIndex has no storage ID');
}
final slots = _slotsSharingChannel(channelIndex);
Future<void> writeSmaz(bool on) async {
await _channelSettingsStore.saveSmazEnabled(channelId, on);
for (final slot in slots) {
_channelSmazEnabled[slot] = on;
}
}
Future<void> writeCyr2Lat(bool on) async {
await _channelSettingsStore.saveCyr2LatEnabled(channelId, on);
for (final slot in slots) {
_channelCyr2LatEnabled[slot] = on;
}
}
try {
if (mode != ChatCompressionMode.smaz) await writeSmaz(false);
if (mode != ChatCompressionMode.cyr2lat) await writeCyr2Lat(false);
if (mode == ChatCompressionMode.smaz) await writeSmaz(true);
if (mode == ChatCompressionMode.cyr2lat) await writeCyr2Lat(true);
} finally {
notifyListeners();
}
});
}
/// Contact counterpart of [setChannelCompressionMode].
Future<void> setContactCompressionMode(
String contactKeyHex,
ChatCompressionMode mode,
) {
return _queueCompressionWrite(() async {
Future<void> writeSmaz(bool on) async {
await _contactSettingsStore.saveSmazEnabled(contactKeyHex, on);
_contactSmazEnabled[contactKeyHex] = on;
}
Future<void> writeCyr2Lat(bool on) async {
await _contactSettingsStore.saveCyr2LatEnabled(contactKeyHex, on);
_contactCyr2LatEnabled[contactKeyHex] = on;
}
try {
if (mode != ChatCompressionMode.smaz) await writeSmaz(false);
if (mode != ChatCompressionMode.cyr2lat) await writeCyr2Lat(false);
if (mode == ChatCompressionMode.smaz) await writeSmaz(true);
if (mode == ChatCompressionMode.cyr2lat) await writeCyr2Lat(true);
} finally {
notifyListeners();
}
});
}
Future<void> setChannelUrlImagesEnabled(
@@ -2151,35 +2219,6 @@ class MeshCoreConnector extends ChangeNotifier {
notifyListeners();
}
Future<void> setChannelCyr2LatEnabled(int channelIndex, bool enabled) async {
final slots = _slotsSharingChannel(channelIndex);
for (final slot in slots) {
_channelCyr2LatEnabled[slot] = enabled;
}
final channelId = _channelIdForSlot(channelIndex);
if (enabled) {
for (final slot in slots) {
_channelSmazEnabled[slot] = false;
}
if (channelId != null) {
await _channelSettingsStore.saveSmazEnabled(channelId, false);
}
}
if (channelId != null) {
await _channelSettingsStore.saveCyr2LatEnabled(channelId, enabled);
}
notifyListeners();
}
Future<void> setContactCyr2LatEnabled(
String contactKeyHex,
bool enabled,
) async {
_contactCyr2LatEnabled[contactKeyHex] = enabled;
await _contactSettingsStore.saveCyr2LatEnabled(contactKeyHex, enabled);
notifyListeners();
}
Future<void> setChannelRegion(int channelIndex, String region) async {
// Update in-memory state and notify synchronously so the UI reflects the
// change immediately; persistence happens in the background.
@@ -2435,6 +2474,9 @@ class MeshCoreConnector extends ChangeNotifier {
_contacts
..clear()
..addAll(cached);
_contactAddedAt
..clear()
..addAll(_contactAddedAtStore.load());
for (final contact in cached) {
_ensureContactSmazSettingLoaded(contact.publicKeyHex);
_ensureContactCyr2LatSettingLoaded(contact.publicKeyHex);
@@ -5097,6 +5139,13 @@ class MeshCoreConnector extends ChangeNotifier {
pathHashByteWidth: pathHashByteWidth,
);
await sendFrame(frame, waitForGenericAck: true);
if (publicKey != null) {
final keyHex = pubKeyToHex(publicKey);
if (!_contactAddedAt.containsKey(keyHex)) {
_contactAddedAt[keyHex] = DateTime.now();
await _contactAddedAtStore.save(_contactAddedAt);
}
}
await refreshContacts();
}
@@ -6092,6 +6141,9 @@ class MeshCoreConnector extends ChangeNotifier {
_contactsStorageFull = false;
_contacts.removeWhere((c) => c.publicKeyHex == contact.publicKeyHex);
_knownContactKeys.remove(contact.publicKeyHex);
if (_contactAddedAt.remove(contact.publicKeyHex) != null) {
unawaited(_contactAddedAtStore.save(_contactAddedAt));
}
unawaited(updateKnownDiscovered());
unawaited(_persistContacts());
_conversations.remove(contact.publicKeyHex);
@@ -7780,6 +7832,9 @@ class MeshCoreConnector extends ChangeNotifier {
);
_contacts.removeWhere((c) => c.publicKeyHex == keyHex);
_knownContactKeys.remove(keyHex);
if (_contactAddedAt.remove(keyHex) != null) {
unawaited(_contactAddedAtStore.save(_contactAddedAt));
}
_contactsStorageFull = false;
unawaited(updateKnownDiscovered());
unawaited(_persistContacts());
@@ -8337,7 +8392,7 @@ class MeshCoreConnector extends ChangeNotifier {
void _ensureContactSmazSettingLoaded(String contactKeyHex) {
if (_contactSmazEnabled.containsKey(contactKeyHex)) return;
_contactSettingsStore.loadSmazEnabled(contactKeyHex).then((enabled) {
if (_contactSmazEnabled[contactKeyHex] == enabled) return;
if (_contactSmazEnabled.containsKey(contactKeyHex)) return;
_contactSmazEnabled[contactKeyHex] = enabled;
notifyListeners();
});
@@ -8346,7 +8401,7 @@ class MeshCoreConnector extends ChangeNotifier {
void _ensureContactCyr2LatSettingLoaded(String contactKeyHex) {
if (_contactCyr2LatEnabled.containsKey(contactKeyHex)) return;
_contactSettingsStore.loadCyr2LatEnabled(contactKeyHex).then((enabled) {
if (_contactCyr2LatEnabled[contactKeyHex] == enabled) return;
if (_contactCyr2LatEnabled.containsKey(contactKeyHex)) return;
_contactCyr2LatEnabled[contactKeyHex] = enabled;
notifyListeners();
});
@@ -8364,7 +8419,7 @@ class MeshCoreConnector extends ChangeNotifier {
void _ensureContactCyr2LatProfileLoaded(String contactKeyHex) {
if (_contactCyr2LatProfileId.containsKey(contactKeyHex)) return;
_contactSettingsStore.loadCyr2LatProfileId(contactKeyHex).then((profileId) {
if (_contactCyr2LatProfileId[contactKeyHex] == profileId) return;
if (_contactCyr2LatProfileId.containsKey(contactKeyHex)) return;
_contactCyr2LatProfileId[contactKeyHex] = profileId;
notifyListeners();
});
@@ -8375,7 +8430,7 @@ class MeshCoreConnector extends ChangeNotifier {
final channelId = _slotChannelIds[channelIndex];
if (channelId == null) return;
_channelSettingsStore.loadCyr2LatEnabled(channelId).then((enabled) {
if (_channelCyr2LatEnabled[channelIndex] == enabled) return;
if (_channelCyr2LatEnabled.containsKey(channelIndex)) return;
_channelCyr2LatEnabled[channelIndex] = enabled;
notifyListeners();
});
@@ -8386,7 +8441,7 @@ class MeshCoreConnector extends ChangeNotifier {
final channelId = _slotChannelIds[channelIndex];
if (channelId == null) return;
_channelSettingsStore.loadCyr2LatProfileId(channelId).then((profileId) {
if (_channelCyr2LatProfileId[channelIndex] == profileId) return;
if (_channelCyr2LatProfileId.containsKey(channelIndex)) return;
_channelCyr2LatProfileId[channelIndex] = profileId;
notifyListeners();
});
@@ -8402,13 +8457,13 @@ class MeshCoreConnector extends ChangeNotifier {
String? profileId,
) async {
if (_channelCyr2LatProfileId[channelIndex] == profileId) return;
for (final slot in _slotsSharingChannel(channelIndex)) {
_channelCyr2LatProfileId[slot] = profileId;
}
final channelId = _channelIdForSlot(channelIndex);
if (channelId != null) {
await _channelSettingsStore.saveCyr2LatProfileId(channelId, profileId);
}
for (final slot in _slotsSharingChannel(channelIndex)) {
_channelCyr2LatProfileId[slot] = profileId;
}
notifyListeners();
}
@@ -8422,8 +8477,8 @@ class MeshCoreConnector extends ChangeNotifier {
String? profileId,
) async {
if (_contactCyr2LatProfileId[contactKeyHex] == profileId) return;
_contactCyr2LatProfileId[contactKeyHex] = profileId;
await _contactSettingsStore.saveCyr2LatProfileId(contactKeyHex, profileId);
_contactCyr2LatProfileId[contactKeyHex] = profileId;
notifyListeners();
}
@@ -9864,6 +9919,7 @@ class MeshCoreConnector extends ChangeNotifier {
_channelRegionStore.setPublicKeyHex = keyHex;
_contactSettingsStore.setPublicKeyHex = keyHex;
_contactStore.setPublicKeyHex = keyHex;
_contactAddedAtStore.setPublicKeyHex = keyHex;
_channelStore.setPublicKeyHex = keyHex;
_unreadStore.setPublicKeyHex = keyHex;
_discoveryContactStore.setPublicKeyHex = keyHex;
+23 -5
View File
@@ -869,6 +869,7 @@
}
},
"contacts_lastSeenNow": "recently",
"contacts_lastSeenNever": "not heard yet",
"contacts_lastSeenMinsAgo": "~ {minutes} min.",
"@contacts_lastSeenMinsAgo": {
"placeholders": {
@@ -998,9 +999,6 @@
}
}
},
"channels_smazCompression": "SMAZ compression",
"channels_cyr2latCompression": "Cyr2Lat compression",
"channels_cyr2latCompressionDscr": "Replaces some Cyrillic characters with Latin characters when sending.",
"channels_cyr2latSettingsHeading": "Cyr2Lat Setup",
"channels_cyr2latSettingsSubheading": "List of replacements",
"channels_cyr2latSettingsDscr": "Edit the JSON configuration of character replacement",
@@ -1439,7 +1437,6 @@
"chat_path": "Path",
"chat_viewPathOnMap": "View path on map",
"chat_publicKey": "Public Key",
"chat_compressOutgoingMessages": "Compress outgoing messages",
"chat_floodForced": "Flood (forced)",
"chat_directForced": "Direct (forced)",
"chat_hopsForced": "{count} hops (forced)",
@@ -4366,5 +4363,26 @@
"chat_composerOffline": "Connect to a radio to send messages",
"@chat_composerOffline": {
"description": "Shown in place of the message box while no radio is connected"
}
},
"chatCompression_title": "Compression",
"chatCompression_label": "Compression: {mode}",
"@chatCompression_label": {
"description": "Always-visible control at the top of a chat; mode is Off, SMAZ or Cyr2Lat",
"placeholders": {
"mode": {
"type": "String"
}
}
},
"chatCompression_off": "Off",
"chatCompression_smaz": "SMAZ",
"chatCompression_cyr2lat": "Cyr2Lat",
"chatCompression_changeHint": "Change compression for this chat",
"chatCompression_sheetSubtitle": "Applies to messages you send in this chat. Saved on this phone.",
"chatCompression_offDescription": "No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.",
"chatCompression_smazDescription": "Lossless compression for short text. The recipient's app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.",
"chatCompression_cyr2latDescription": "Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.",
"chatCompression_profile": "Cyr2Lat profile",
"chatCompression_noStorageId": "Can't change compression until this channel has synced from the radio.",
"chatCompression_saveFailed": "Couldn't save the compression setting. Showing the saved setting."
}
+84 -24
View File
@@ -3319,6 +3319,12 @@ abstract class AppLocalizations {
/// **'recently'**
String get contacts_lastSeenNow;
/// No description provided for @contacts_lastSeenNever.
///
/// In en, this message translates to:
/// **'not heard yet'**
String get contacts_lastSeenNever;
/// No description provided for @contacts_lastSeenMinsAgo.
///
/// In en, this message translates to:
@@ -3631,24 +3637,6 @@ abstract class AppLocalizations {
/// **'Edit Channel {index}'**
String channels_editChannelTitle(int index);
/// No description provided for @channels_smazCompression.
///
/// In en, this message translates to:
/// **'SMAZ compression'**
String get channels_smazCompression;
/// No description provided for @channels_cyr2latCompression.
///
/// In en, this message translates to:
/// **'Cyr2Lat compression'**
String get channels_cyr2latCompression;
/// No description provided for @channels_cyr2latCompressionDscr.
///
/// In en, this message translates to:
/// **'Replaces some Cyrillic characters with Latin characters when sending.'**
String get channels_cyr2latCompressionDscr;
/// No description provided for @channels_cyr2latSettingsHeading.
///
/// In en, this message translates to:
@@ -4837,12 +4825,6 @@ abstract class AppLocalizations {
/// **'Public Key'**
String get chat_publicKey;
/// No description provided for @chat_compressOutgoingMessages.
///
/// In en, this message translates to:
/// **'Compress outgoing messages'**
String get chat_compressOutgoingMessages;
/// No description provided for @chat_floodForced.
///
/// In en, this message translates to:
@@ -12657,6 +12639,84 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Connect to a radio to send messages'**
String get chat_composerOffline;
/// No description provided for @chatCompression_title.
///
/// In en, this message translates to:
/// **'Compression'**
String get chatCompression_title;
/// Always-visible control at the top of a chat; mode is Off, SMAZ or Cyr2Lat
///
/// In en, this message translates to:
/// **'Compression: {mode}'**
String chatCompression_label(String mode);
/// No description provided for @chatCompression_off.
///
/// In en, this message translates to:
/// **'Off'**
String get chatCompression_off;
/// No description provided for @chatCompression_smaz.
///
/// In en, this message translates to:
/// **'SMAZ'**
String get chatCompression_smaz;
/// No description provided for @chatCompression_cyr2lat.
///
/// In en, this message translates to:
/// **'Cyr2Lat'**
String get chatCompression_cyr2lat;
/// No description provided for @chatCompression_changeHint.
///
/// In en, this message translates to:
/// **'Change compression for this chat'**
String get chatCompression_changeHint;
/// No description provided for @chatCompression_sheetSubtitle.
///
/// In en, this message translates to:
/// **'Applies to messages you send in this chat. Saved on this phone.'**
String get chatCompression_sheetSubtitle;
/// No description provided for @chatCompression_offDescription.
///
/// In en, this message translates to:
/// **'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.'**
String get chatCompression_offDescription;
/// No description provided for @chatCompression_smazDescription.
///
/// In en, this message translates to:
/// **'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.'**
String get chatCompression_smazDescription;
/// No description provided for @chatCompression_cyr2latDescription.
///
/// In en, this message translates to:
/// **'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.'**
String get chatCompression_cyr2latDescription;
/// No description provided for @chatCompression_profile.
///
/// In en, this message translates to:
/// **'Cyr2Lat profile'**
String get chatCompression_profile;
/// No description provided for @chatCompression_noStorageId.
///
/// In en, this message translates to:
/// **'Can\'t change compression until this channel has synced from the radio.'**
String get chatCompression_noStorageId;
/// No description provided for @chatCompression_saveFailed.
///
/// In en, this message translates to:
/// **'Couldn\'t save the compression setting. Showing the saved setting.'**
String get chatCompression_saveFailed;
}
class _AppLocalizationsDelegate
+50 -14
View File
@@ -1856,6 +1856,9 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'наскоро';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes мин.';
@@ -2038,16 +2041,6 @@ class AppLocalizationsBg extends AppLocalizations {
return 'Редактирай Канал $index';
}
@override
String get channels_smazCompression => 'Компресия SMAZ';
@override
String get channels_cyr2latCompression => 'Компресия Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Заменя някои кирилични символи с латиница при изпращане.';
@override
String get channels_cyr2latSettingsHeading => 'Настройки на Cyr2Lat';
@@ -2775,10 +2768,6 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get chat_publicKey => 'Публичен ключ';
@override
String get chat_compressOutgoingMessages =>
'Компресиране на изходящи съобщения';
@override
String get chat_floodForced => 'Flood (принудително)';
@@ -7600,4 +7589,51 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get chat_composerOffline =>
'Свържете се с радио, за да изпращате съобщения';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1843,6 +1843,9 @@ class AppLocalizationsCs extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'nedávno';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min.';
@@ -2023,16 +2026,6 @@ class AppLocalizationsCs extends AppLocalizations {
return 'Upravit kanál $index';
}
@override
String get channels_smazCompression => 'Komprese SMAZ';
@override
String get channels_cyr2latCompression => 'Komprese Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Při odesílání nahradí některé znaky cyrilice latinkou.';
@override
String get channels_cyr2latSettingsHeading => 'Nastavení Cyr2Lat';
@@ -2765,9 +2758,6 @@ class AppLocalizationsCs extends AppLocalizations {
@override
String get chat_publicKey => 'Veřejný klíč';
@override
String get chat_compressOutgoingMessages => 'Komprimovat odchozí zprávy';
@override
String get chat_floodForced => 'Flood (vynuceno)';
@@ -7570,4 +7560,51 @@ class AppLocalizationsCs extends AppLocalizations {
@override
String get chat_composerOffline => 'Pro odesílání zpráv se připojte k rádiu';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -14
View File
@@ -1856,6 +1856,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'gerade eben';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes Min.';
@@ -2038,16 +2041,6 @@ class AppLocalizationsDe extends AppLocalizations {
return 'Kanal $index bearbeiten';
}
@override
String get channels_smazCompression => 'SMAZ-Komprimierung';
@override
String get channels_cyr2latCompression => 'Cyr2Lat-Komprimierung';
@override
String get channels_cyr2latCompressionDscr =>
'Ersetzt beim Senden einige kyrillische Zeichen durch lateinische Zeichen.';
@override
String get channels_cyr2latSettingsHeading => 'Cyr2Lat-Einstellungen';
@@ -2777,10 +2770,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get chat_publicKey => 'Öffentlicher Schlüssel';
@override
String get chat_compressOutgoingMessages =>
'Komprimieren ausgehender Nachrichten';
@override
String get chat_floodForced => 'Flood (erzwungen)';
@@ -7615,4 +7604,51 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get chat_composerOffline =>
'Mit einem Funkgerät verbinden, um Nachrichten zu senden';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1823,6 +1823,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'recently';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min.';
@@ -2002,16 +2005,6 @@ class AppLocalizationsEn extends AppLocalizations {
return 'Edit Channel $index';
}
@override
String get channels_smazCompression => 'SMAZ compression';
@override
String get channels_cyr2latCompression => 'Cyr2Lat compression';
@override
String get channels_cyr2latCompressionDscr =>
'Replaces some Cyrillic characters with Latin characters when sending.';
@override
String get channels_cyr2latSettingsHeading => 'Cyr2Lat Setup';
@@ -2729,9 +2722,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get chat_publicKey => 'Public Key';
@override
String get chat_compressOutgoingMessages => 'Compress outgoing messages';
@override
String get chat_floodForced => 'Flood (forced)';
@@ -7486,4 +7476,51 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get chat_composerOffline => 'Connect to a radio to send messages';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1848,6 +1848,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'Reciente';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min';
@@ -2031,16 +2034,6 @@ class AppLocalizationsEs extends AppLocalizations {
return 'Editar Canal $index';
}
@override
String get channels_smazCompression => 'Compresión SMAZ';
@override
String get channels_cyr2latCompression => 'Compresión Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Reemplaza algunos caracteres cirílicos con caracteres latinos al enviar.';
@override
String get channels_cyr2latSettingsHeading => 'Configuración de Cyr2Lat';
@@ -2767,9 +2760,6 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get chat_publicKey => 'Clave pública';
@override
String get chat_compressOutgoingMessages => 'Comprimir mensajes salientes';
@override
String get chat_floodForced => 'Flood (forzado)';
@@ -7591,4 +7581,51 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get chat_composerOffline =>
'Conéctate a una radio para enviar mensajes';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -14
View File
@@ -1853,6 +1853,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'À l\'instant';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min';
@@ -2035,16 +2038,6 @@ class AppLocalizationsFr extends AppLocalizations {
return 'Modifier le Canal $index';
}
@override
String get channels_smazCompression => 'Compression SMAZ';
@override
String get channels_cyr2latCompression => 'Compression Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Remplace certains caractères cyrilliques par des caractères latins lors de l\'envoi.';
@override
String get channels_cyr2latSettingsHeading => 'Paramètres Cyr2Lat';
@@ -2772,10 +2765,6 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get chat_publicKey => 'Clé publique';
@override
String get chat_compressOutgoingMessages =>
'Compresser les messages sortants';
@override
String get chat_floodForced => 'Flood (forcé)';
@@ -7620,4 +7609,51 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get chat_composerOffline =>
'Connectez-vous à une radio pour envoyer des messages';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1846,6 +1846,9 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'nemrég';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min.';
@@ -2029,16 +2032,6 @@ class AppLocalizationsHu extends AppLocalizations {
return 'Csatorna szerkesztése $index';
}
@override
String get channels_smazCompression => 'SMAZ tömörítés';
@override
String get channels_cyr2latCompression => 'Cyr2Lat tömörítés';
@override
String get channels_cyr2latCompressionDscr =>
'Küldéskor egyes cirill karaktereket latin karakterekre cserél.';
@override
String get channels_cyr2latSettingsHeading => 'Cyr2Lat beállítás';
@@ -2764,9 +2757,6 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get chat_publicKey => 'Nyilvános kulcs';
@override
String get chat_compressOutgoingMessages => 'A kimenő üzenetek tömörítése';
@override
String get chat_floodForced => 'Flood (kényszerített)';
@@ -7583,4 +7573,51 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get chat_composerOffline => 'Üzenetküldéshez csatlakozzon rádióhoz';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1850,6 +1850,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'Poco fa';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min';
@@ -2032,16 +2035,6 @@ class AppLocalizationsIt extends AppLocalizations {
return 'Modifica Canale $index';
}
@override
String get channels_smazCompression => 'Compressione SMAZ';
@override
String get channels_cyr2latCompression => 'Compressione Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Sostituisce alcuni caratteri cirillici con caratteri latini durante l\'invio.';
@override
String get channels_cyr2latSettingsHeading => 'Impostazioni Cyr2Lat';
@@ -2772,9 +2765,6 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get chat_publicKey => 'Chiave pubblica';
@override
String get chat_compressOutgoingMessages => 'Comprimi messaggi in uscita';
@override
String get chat_floodForced => 'Flood (forzato)';
@@ -7603,4 +7593,51 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get chat_composerOffline =>
'Connettiti a una radio per inviare messaggi';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -12
View File
@@ -1759,6 +1759,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get contacts_lastSeenNow => '最近';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '約 $minutes 分前';
@@ -1937,15 +1940,6 @@ class AppLocalizationsJa extends AppLocalizations {
return 'チャンネル $index の編集';
}
@override
String get channels_smazCompression => 'SMAZ 圧縮';
@override
String get channels_cyr2latCompression => 'Cyr2Lat 圧縮';
@override
String get channels_cyr2latCompressionDscr => '送信時に一部のキリル文字をラテン文字に置き換えます。';
@override
String get channels_cyr2latSettingsHeading => 'Cyr2Lat 設定';
@@ -2645,9 +2639,6 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get chat_publicKey => '公開鍵';
@override
String get chat_compressOutgoingMessages => '送信メッセージを圧縮する';
@override
String get chat_floodForced => 'フラッド(強制)';
@@ -7245,4 +7236,51 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get chat_composerOffline => 'メッセージを送信するには無線機に接続してください';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -12
View File
@@ -1763,6 +1763,9 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get contacts_lastSeenNow => '최근';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes분';
@@ -1941,15 +1944,6 @@ class AppLocalizationsKo extends AppLocalizations {
return '채널 $index 편집';
}
@override
String get channels_smazCompression => 'SMAZ 압축';
@override
String get channels_cyr2latCompression => 'Cyr2Lat 압축';
@override
String get channels_cyr2latCompressionDscr => '보낼 때 일부 키릴 문자를 라틴 문자로 바꿉니다.';
@override
String get channels_cyr2latSettingsHeading => 'Cyr2Lat 설정';
@@ -2648,9 +2642,6 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get chat_publicKey => '공개 키';
@override
String get chat_compressOutgoingMessages => '전송되는 메시지 압축';
@override
String get chat_floodForced => '플러딩 (강제)';
@@ -7258,4 +7249,51 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get chat_composerOffline => '메시지를 보내려면 무전기에 연결하세요';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1842,6 +1842,9 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'recent';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min.';
@@ -2022,16 +2025,6 @@ class AppLocalizationsNl extends AppLocalizations {
return 'Bewerk Kanaal $index';
}
@override
String get channels_smazCompression => 'SMAZ compressie';
@override
String get channels_cyr2latCompression => 'Cyr2Lat compressie';
@override
String get channels_cyr2latCompressionDscr =>
'Vervangt sommige Cyrillische tekens door Latijnse tekens bij het verzenden.';
@override
String get channels_cyr2latSettingsHeading => 'Instellingen Cyr2Lat';
@@ -2756,9 +2749,6 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get chat_publicKey => 'Openbare Sleutel';
@override
String get chat_compressOutgoingMessages => 'Uitgaande berichten comprimeren';
@override
String get chat_floodForced => 'Flood (afgedwongen)';
@@ -7559,4 +7549,51 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get chat_composerOffline =>
'Verbind met een radio om berichten te versturen';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1864,6 +1864,9 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'niedawno';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min';
@@ -2046,16 +2049,6 @@ class AppLocalizationsPl extends AppLocalizations {
return 'Edytuj Kanał $index';
}
@override
String get channels_smazCompression => 'Kompresja SMAZ';
@override
String get channels_cyr2latCompression => 'Kompresja Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Zastępuje niektóre znaki cyrylicy alfabetem łacińskim podczas wysyłania.';
@override
String get channels_cyr2latSettingsHeading => 'Ustawienia Cyr2Lat';
@@ -2799,9 +2792,6 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get chat_publicKey => 'Klucz Publiczny';
@override
String get chat_compressOutgoingMessages => 'Kompresuj wychodzące wiadomości';
@override
String get chat_floodForced => 'Flood (wymuszony)';
@@ -7637,4 +7627,51 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get chat_composerOffline =>
'Połącz się z radiem, aby wysyłać wiadomości';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -26
View File
@@ -1849,6 +1849,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'Recente';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min';
@@ -2031,16 +2034,6 @@ class AppLocalizationsPt extends AppLocalizations {
return 'Editar Canal $index';
}
@override
String get channels_smazCompression => 'Compressão SMAZ';
@override
String get channels_cyr2latCompression => 'Compressão Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Substitui alguns caracteres cirílicos por caracteres latinos ao enviar.';
@override
String get channels_cyr2latSettingsHeading => 'Configuração do Cyr2Lat';
@@ -2766,9 +2759,6 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get chat_publicKey => 'Chave Pública';
@override
String get chat_compressOutgoingMessages => 'Comprimir mensagens enviadas';
@override
String get chat_floodForced => 'Flood (forçado)';
@@ -7581,6 +7571,53 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get chat_composerOffline =>
'Conecte-se a um rádio para enviar mensagens';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
/// The translations for Portuguese, as used in Portugal (`pt_PT`).
@@ -9582,16 +9619,6 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
return 'Editar canal $index';
}
@override
String get channels_smazCompression => 'Compressão SMAZ';
@override
String get channels_cyr2latCompression => 'Compressão Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Substitui alguns caracteres cirílicos por latinos ao enviar.';
@override
String get channels_cyr2latSettingsHeading => 'Configuração Cyr2Lat';
@@ -10291,9 +10318,6 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
@override
String get chat_publicKey => 'Chave pública';
@override
String get chat_compressOutgoingMessages => 'Comprimir mensagens enviadas';
@override
String get chat_floodForced => 'Flood (forçado)';
+50 -13
View File
@@ -1848,6 +1848,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'недавно';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes мин.';
@@ -2030,16 +2033,6 @@ class AppLocalizationsRu extends AppLocalizations {
return 'Изменить канал $index';
}
@override
String get channels_smazCompression => 'Сжатие SMAZ';
@override
String get channels_cyr2latCompression => 'Сжатие Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Заменяет некоторые кириллические символы на латиницу при отправке.';
@override
String get channels_cyr2latSettingsHeading => 'Настройка Cyr2Lat';
@@ -2778,9 +2771,6 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get chat_publicKey => 'Публичный ключ';
@override
String get chat_compressOutgoingMessages => 'Сжимать исходящие сообщения';
@override
String get chat_floodForced => 'Flood (принудительно)';
@@ -7617,4 +7607,51 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get chat_composerOffline =>
'Подключитесь к радио, чтобы отправлять сообщения';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1842,6 +1842,9 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'nedávno';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min.';
@@ -2023,16 +2026,6 @@ class AppLocalizationsSk extends AppLocalizations {
return 'Upraviť kanál $index';
}
@override
String get channels_smazCompression => 'Odstránenie kompresie SMAZ';
@override
String get channels_cyr2latCompression => 'Odstránenie kompresie Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Pri odosielaní nahradí niektoré znaky cyriliky latinskými znakmi.';
@override
String get channels_cyr2latSettingsHeading => 'Nastavenia Cyr2Lat';
@@ -2770,9 +2763,6 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get chat_publicKey => 'Verejný kľúč';
@override
String get chat_compressOutgoingMessages => 'Komprimovať odoslané správy';
@override
String get chat_floodForced => 'Flood (vynútený)';
@@ -7582,4 +7572,51 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get chat_composerOffline => 'Na odosielanie správ sa pripojte k rádiu';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1840,6 +1840,9 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'pravkar';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min';
@@ -2021,16 +2024,6 @@ class AppLocalizationsSl extends AppLocalizations {
return 'Uredi Kanal $index';
}
@override
String get channels_smazCompression => 'Kompresija SMAZ';
@override
String get channels_cyr2latCompression => 'Kompresija Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Pri pošiljanju nekatere cirilice nadomesti z latiničnimi.';
@override
String get channels_cyr2latSettingsHeading => 'Nastavitve Cyr2Lat';
@@ -2765,9 +2758,6 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get chat_publicKey => 'Ključ javnega tipa';
@override
String get chat_compressOutgoingMessages => 'Stisnite izhodne sporočila';
@override
String get chat_floodForced => 'Flood (vsiljeno)';
@@ -7576,4 +7566,51 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get chat_composerOffline =>
'Za pošiljanje sporočil se povežite z radiem';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1830,6 +1830,9 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'nyss';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes min';
@@ -2009,16 +2012,6 @@ class AppLocalizationsSv extends AppLocalizations {
return 'Redigera Kanal $index';
}
@override
String get channels_smazCompression => 'SMAZ-komprimering';
@override
String get channels_cyr2latCompression => 'Cyr2Lat-komprimering';
@override
String get channels_cyr2latCompressionDscr =>
'Ersätter vissa kyrilliska tecken med latinska tecken när du skickar.';
@override
String get channels_cyr2latSettingsHeading => 'Inställningar för Cyr2Lat';
@@ -2744,9 +2737,6 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get chat_publicKey => 'Publik nyckel';
@override
String get chat_compressOutgoingMessages => 'Komprimera utgående meddelanden';
@override
String get chat_floodForced => 'Flood (tvingad)';
@@ -7536,4 +7526,51 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get chat_composerOffline =>
'Anslut till en radio för att skicka meddelanden';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -13
View File
@@ -1844,6 +1844,9 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get contacts_lastSeenNow => 'нещодавно';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '~ $minutes хв.';
@@ -2026,16 +2029,6 @@ class AppLocalizationsUk extends AppLocalizations {
return 'Редагувати канал $index';
}
@override
String get channels_smazCompression => 'Стиснення SMAZ';
@override
String get channels_cyr2latCompression => 'Стиснення Cyr2Lat';
@override
String get channels_cyr2latCompressionDscr =>
'Замінює деякі кириличні символи на латиницю при відправці.';
@override
String get channels_cyr2latSettingsHeading => 'Налаштування Cyr2Lat';
@@ -2775,9 +2768,6 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get chat_publicKey => 'Відкритий ключ';
@override
String get chat_compressOutgoingMessages => 'Стискати вихідні повідомлення';
@override
String get chat_floodForced => 'Flood (примусово)';
@@ -7629,4 +7619,51 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get chat_composerOffline =>
'Підключіться до радіо, щоб надсилати повідомлення';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+50 -12
View File
@@ -1733,6 +1733,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get contacts_lastSeenNow => '刚刚';
@override
String get contacts_lastSeenNever => 'not heard yet';
@override
String contacts_lastSeenMinsAgo(int minutes) {
return '约 $minutes 分钟';
@@ -1911,15 +1914,6 @@ class AppLocalizationsZh extends AppLocalizations {
return '编辑频道 $index';
}
@override
String get channels_smazCompression => 'SMAZ 压缩';
@override
String get channels_cyr2latCompression => 'Cyr2Lat 压缩';
@override
String get channels_cyr2latCompressionDscr => '发送时将一些西里尔字符替换为拉丁字符。';
@override
String get channels_cyr2latSettingsHeading => 'Cyr2Lat 設定';
@@ -2604,9 +2598,6 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get chat_publicKey => '公钥';
@override
String get chat_compressOutgoingMessages => '压缩发送的消息';
@override
String get chat_floodForced => '泛洪(强制)';
@@ -7088,4 +7079,51 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get chat_composerOffline => '连接到无线电后才能发送消息';
@override
String get chatCompression_title => 'Compression';
@override
String chatCompression_label(String mode) {
return 'Compression: $mode';
}
@override
String get chatCompression_off => 'Off';
@override
String get chatCompression_smaz => 'SMAZ';
@override
String get chatCompression_cyr2lat => 'Cyr2Lat';
@override
String get chatCompression_changeHint => 'Change compression for this chat';
@override
String get chatCompression_sheetSubtitle =>
'Applies to messages you send in this chat. Saved on this phone.';
@override
String get chatCompression_offDescription =>
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
@override
String get chatCompression_smazDescription =>
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
@override
String get chatCompression_cyr2latDescription =>
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
@override
String get chatCompression_profile => 'Cyr2Lat profile';
@override
String get chatCompression_noStorageId =>
'Can\'t change compression until this channel has synced from the radio.';
@override
String get chatCompression_saveFailed =>
'Couldn\'t save the compression setting. Showing the saved setting.';
}
+3
View File
@@ -0,0 +1,3 @@
/// Outgoing text transformation chosen for one contact or channel chat.
/// Stored as the existing SMAZ and Cyr2Lat flags, at most one of them on.
enum ChatCompressionMode { off, smaz, cyr2lat }
+61 -62
View File
@@ -53,6 +53,7 @@ import '../widgets/empty_state.dart';
import '../widgets/filter_rule_dialog.dart';
import '../widgets/filtered_message_ghost.dart';
import '../widgets/chat_composer.dart';
import '../widgets/chat_compression_selector.dart';
import '../widgets/chat_send_pipeline.dart';
import '../widgets/chat_zoom_wrapper.dart';
import '../widgets/message_bubble_frame.dart';
@@ -843,12 +844,17 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
? _buildSearchResults(_loadSearchEntries)
: SafeArea(
top: false,
// The composer panel pads the bottom inset itself, so the
// background runs behind it to the screen edge.
bottom: false,
child: Column(
children: [
_buildCompressionSelector(),
Expanded(
child: ChatBackdrop(
key: _messageAreaKey,
contentKey: _messageAreaKey,
chatKey: ChatBackgroundService.channelKey(widget.channel),
footer: _buildInputBar(),
child: Consumer<MeshCoreConnector>(
builder: (context, connector, child) {
final messages = connector.getChannelMessages(
@@ -1064,7 +1070,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
),
),
),
_buildInputBar(),
],
),
),
@@ -2633,47 +2638,23 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
);
}
Widget _buildReplyBanner(double textScale) {
Widget _buildComposerReplyQuote(double textScale) {
final message = _replyingToMessage!;
final scheme = Theme.of(context).colorScheme;
final replyRegion = message.region;
return Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: scheme.surfaceContainerHigh,
border: Border(
bottom: BorderSide(color: scheme.outlineVariant, width: 1),
),
return ChatComposerQuote(
title: context.l10n.chat_replyingTo(message.senderName),
content: _buildReplyContent(
message.text,
textScale,
color: scheme.onSurfaceVariant,
maxLines: 1,
gifSize: 48,
),
child: Row(
children: [
Icon(Icons.reply, size: 18, color: scheme.primary),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.l10n.chat_replyingTo(message.senderName),
style: MeshTheme.mono(
fontSize: 12 * textScale,
fontWeight: FontWeight.w700,
color: scheme.primary,
),
),
_buildReplyContent(
message.text,
textScale,
color: scheme.onSurfaceVariant,
maxLines: 1,
gifSize: 48,
),
],
),
),
if (replyRegion?.isNotEmpty ?? false)
InkWell(
onDismiss: _cancelReply,
dismissTooltip: context.l10n.chat_cancelReply,
trailing: (replyRegion?.isNotEmpty ?? false)
? InkWell(
borderRadius: BorderRadius.circular(MeshRadii.xs),
onTap: () => setState(() => _useReplyRegion = !_useReplyRegion),
child: Container(
@@ -2691,6 +2672,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
),
child: Text(
context.l10n.channels_regionSetTo(replyRegion!),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style:
MeshTheme.mono(
fontSize: 12 * textScale,
@@ -2704,17 +2687,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
),
),
),
),
const SizedBox(width: 4),
IconButton(
icon: const Icon(Icons.close, size: 18),
tooltip: context.l10n.chat_cancelReply,
onPressed: _cancelReply,
color: scheme.onSurfaceVariant,
constraints: const BoxConstraints(minWidth: 44, minHeight: 44),
),
],
),
)
: null,
);
}
@@ -2753,6 +2727,32 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
static String _replyPrefix(ChannelMessage replyTo) =>
'@[${replyTo.senderName}] ';
/// Compression is stored on this phone under the channel's storage ID, so
/// it can change while the radio is offline, but not before the slot has
/// one.
Widget _buildCompressionSelector() {
final slot = widget.channel.index;
return Consumer2<MeshCoreConnector, AppSettingsService>(
builder: (context, connector, settingsService, _) {
final hasStorageId = connector.channelIdForSlot(slot) != null;
return ChatCompressionSelector(
mode: connector.channelCompressionMode(slot),
enabled: hasStorageId,
disabledReason: hasStorageId
? null
: context.l10n.chatCompression_noStorageId,
profiles: settingsService.settings.cyr2latProfiles,
profileId: connector.getChannelCyr2LatProfileId(slot),
defaultProfileId: settingsService.settings.selectedCyr2latProfileId,
onModeChanged: (mode) =>
connector.setChannelCompressionMode(slot, mode),
onProfileChanged: (id) =>
connector.setChannelCyr2LatProfileId(slot, id),
);
},
);
}
Widget _buildInputBar() {
// Only the fields the composer depends on, so unrelated connector
// notifications (adverts, other chats, radio stats) don't rebuild it.
@@ -2790,18 +2790,17 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
: null,
onSend: _sendMessage,
sendTooltip: context.l10n.chat_sendMessage,
header: [
if (replyTo != null)
Builder(
builder: (context) {
final textScale = context.select<ChatTextScaleService, double>(
(service) => service.scale,
);
return _buildReplyBanner(textScale);
},
),
if (_imageSendTotal > 0) _buildImageSendProgress(scheme),
],
header: [if (_imageSendTotal > 0) _buildImageSendProgress(scheme)],
replyPreview: replyTo == null
? null
: Builder(
builder: (context) {
final textScale = context.select<ChatTextScaleService, double>(
(service) => service.scale,
);
return _buildComposerReplyQuote(textScale);
},
),
actionsBuilder: () {
final connector = context.read<MeshCoreConnector>();
return [
+22 -74
View File
@@ -783,13 +783,14 @@ class _ChannelsScreenState extends State<ChannelsScreen> {
break;
case ChannelSortOption.latestMessages:
// Filtered messages don't bump a channel, matching the preview.
// Ordered by local arrival time: sender clocks can be far off.
// Looked up once per channel: the lookup can scan back through
// filtered messages, and the comparator runs O(n log n) times.
final epoch = DateTime(1970);
final latest = <Channel, DateTime>{
for (final channel in filtered)
channel:
connector.latestVisibleChannelMessage(channel)?.timestamp ??
connector.latestVisibleChannelMessage(channel)?.receivedAt ??
epoch,
};
filtered.sort((a, b) {
@@ -1951,16 +1952,11 @@ void showEditChannelSheet(
context,
listen: false,
);
bool smazEnabled = connector.isChannelSmazEnabled(channel.index);
bool cyr2latEnabled = connector.isChannelCyr2LatEnabled(channel.index);
final initialUrlImagesEnabled = connector.isChannelUrlImagesEnabled(
channel.index,
);
bool urlImagesEnabled = initialUrlImagesEnabled;
final loadLinkImages = appSettingsService.settings.loadLinkImages;
String? selectedCyr2LatProfileId = connector.getChannelCyr2LatProfileId(
channel.index,
);
showMeshSheet(
context,
@@ -2018,62 +2014,6 @@ void showEditChannelSheet(
),
),
const SizedBox(height: 16),
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(sheetContext.l10n.channels_smazCompression),
value: smazEnabled,
onChanged: (value) => setSheetState(() {
smazEnabled = value;
if (smazEnabled) {
cyr2latEnabled = false;
}
}),
),
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(
sheetContext.l10n.channels_cyr2latCompression,
),
subtitle: Text(
sheetContext.l10n.channels_cyr2latCompressionDscr,
),
value: cyr2latEnabled,
onChanged: (value) => setSheetState(() {
cyr2latEnabled = value;
if (cyr2latEnabled) {
smazEnabled = false;
}
}),
),
if (cyr2latEnabled) ...[
Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 8),
child: DropdownButtonFormField<String>(
isExpanded: true,
initialValue: selectedCyr2LatProfileId,
decoration: InputDecoration(
labelText: sheetContext
.l10n
.channels_cyr2latSettingsSubheading,
border: const OutlineInputBorder(),
),
items: appSettingsService.settings.cyr2latProfiles
.map((profile) {
return DropdownMenuItem(
value: profile.id,
child: Text(
profile.name,
overflow: TextOverflow.ellipsis,
),
);
})
.toList(),
onChanged: (value) => setSheetState(() {
selectedCyr2LatProfileId = value;
}),
),
),
],
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(sheetContext.l10n.urlImage_enable),
@@ -2135,30 +2075,38 @@ void showEditChannelSheet(
}
Navigator.pop(sheetContext);
// A new PSK gives the channel a new storage ID;
// its compression settings move with it.
final previousId = connector.channelIdForSlot(
channel.index,
);
final compression = connector
.channelCompressionMode(channel.index);
final cyr2LatProfileId = connector
.getChannelCyr2LatProfileId(channel.index);
try {
await connector.setChannel(
channel.index,
name,
psk,
);
await connector.setChannelSmazEnabled(
channel.index,
smazEnabled,
);
await connector.setChannelCyr2LatEnabled(
channel.index,
cyr2latEnabled,
);
if (connector.channelIdForSlot(channel.index) !=
previousId) {
await connector.setChannelCompressionMode(
channel.index,
compression,
);
await connector.setChannelCyr2LatProfileId(
channel.index,
cyr2LatProfileId,
);
}
if (urlImagesEnabled != initialUrlImagesEnabled) {
await connector.setChannelUrlImagesEnabled(
channel.index,
urlImagesEnabled,
);
}
await connector.setChannelCyr2LatProfileId(
channel.index,
selectedCyr2LatProfileId,
);
if (!context.mounted) return;
showDismissibleSnackBar(
context,
+27 -97
View File
@@ -37,6 +37,7 @@ import '../services/chat_text_scale_service.dart';
import '../services/path_history_service.dart';
import '../services/translation_service.dart';
import '../widgets/chat_composer.dart';
import '../widgets/chat_compression_selector.dart';
import '../widgets/chat_send_pipeline.dart';
import '../widgets/chat_zoom_wrapper.dart';
import '../widgets/message_bubble_frame.dart';
@@ -622,12 +623,14 @@ class _ChatScreenState extends State<ChatScreen> {
);
return Column(
children: [
_buildCompressionSelector(connector),
Expanded(
child: ChatBackdrop(
key: _messageAreaKey,
contentKey: _messageAreaKey,
chatKey: ChatBackgroundService.contactKey(
widget.contact,
),
footer: _buildInputBar(connector),
child: Stack(
children: [
messages.isEmpty
@@ -640,7 +643,6 @@ class _ChatScreenState extends State<ChatScreen> {
),
),
),
_buildInputBar(connector),
],
);
},
@@ -648,6 +650,27 @@ class _ChatScreenState extends State<ChatScreen> {
);
}
/// Compression is stored on this phone per contact, so it can change
/// while the radio is offline.
Widget _buildCompressionSelector(MeshCoreConnector connector) {
final keyHex = widget.contact.publicKeyHex;
return Consumer<AppSettingsService>(
builder: (context, settingsService, _) {
return ChatCompressionSelector(
mode: connector.contactCompressionMode(keyHex),
enabled: true,
profiles: settingsService.settings.cyr2latProfiles,
profileId: connector.getContactCyr2LatProfileId(keyHex),
defaultProfileId: settingsService.settings.selectedCyr2latProfileId,
onModeChanged: (mode) =>
connector.setContactCompressionMode(keyHex, mode),
onProfileChanged: (id) =>
connector.setContactCyr2LatProfileId(keyHex, id),
);
},
);
}
Widget _buildEmptyState() {
if (_showBookmarkedOnly) return _buildBookmarkEmptyState();
return EmptyState(
@@ -1109,19 +1132,9 @@ class _ChatScreenState extends State<ChatScreen> {
void _showContactSettings(BuildContext context) {
final connector = Provider.of<MeshCoreConnector>(context, listen: false);
final appSettingsService = Provider.of<AppSettingsService>(
context,
listen: false,
);
connector.ensureContactSmazSettingLoaded(widget.contact.publicKeyHex);
connector.ensureContactCyr2LatSettingLoaded(widget.contact.publicKeyHex);
// The live contact carries the current telemetry flags; widget.contact
// is the snapshot this screen was opened with.
final contact = _resolveContact(connector);
bool smazEnabled = connector.isContactSmazEnabled(contact.publicKeyHex);
bool cyr2latEnabled = connector.isContactCyr2LatEnabled(
contact.publicKeyHex,
);
bool urlImagesEnabled = connector.isContactUrlImagesEnabled(
contact.publicKeyHex,
);
@@ -1129,14 +1142,11 @@ class _ChatScreenState extends State<ChatScreen> {
.read<AppSettingsService>()
.settings
.loadLinkImages;
String? selectedCyr2LatProfileId = connector.getContactCyr2LatProfileId(
contact.publicKeyHex,
);
bool teleBaseEnabled = contact.teleBaseEnabled;
bool teleLocEnabled = contact.teleLocEnabled;
bool teleEnvEnabled = contact.teleEnvEnabled;
// Each toggle is committed immediately, like the compression switches,
// so dismissing the dialog by tapping outside keeps the change. All three
// Each toggle is committed immediately, like the link-image switch, so
// dismissing the dialog by tapping outside keeps the change. All three
// flags are sent every time so overlapping writes can't undo each other.
void commitTelemetryFlags() {
connector.setContactFlags(
@@ -1164,86 +1174,6 @@ class _ChatScreenState extends State<ChatScreen> {
),
const Divider(height: 8),
],
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(context.l10n.channels_smazCompression),
subtitle: Text(context.l10n.chat_compressOutgoingMessages),
value: smazEnabled,
onChanged: (value) {
connector.setContactSmazEnabled(
contact.publicKeyHex,
value,
);
connector.setContactCyr2LatEnabled(
contact.publicKeyHex,
false,
);
setDialogState(() {
smazEnabled = value;
if (smazEnabled) {
cyr2latEnabled = false;
}
});
},
),
const Divider(height: 8),
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(context.l10n.channels_cyr2latCompression),
subtitle: Text(context.l10n.channels_cyr2latCompressionDscr),
value: cyr2latEnabled,
onChanged: (value) {
connector.setContactCyr2LatEnabled(
contact.publicKeyHex,
value,
);
connector.setContactSmazEnabled(
contact.publicKeyHex,
false,
);
setDialogState(() {
cyr2latEnabled = value;
if (cyr2latEnabled) {
smazEnabled = false;
}
});
},
),
if (cyr2latEnabled) ...[
Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 8),
child: DropdownButtonFormField<String>(
isExpanded: true,
initialValue: selectedCyr2LatProfileId,
decoration: InputDecoration(
labelText:
context.l10n.channels_cyr2latSettingsSubheading,
border: const OutlineInputBorder(),
),
items: appSettingsService.settings.cyr2latProfiles.map((
profile,
) {
return DropdownMenuItem(
value: profile.id,
child: Text(
profile.name,
overflow: TextOverflow.ellipsis,
),
);
}).toList(),
onChanged: (value) {
connector.setContactCyr2LatProfileId(
contact.publicKeyHex,
value,
);
setDialogState(() {
selectedCyr2LatProfileId = value;
});
},
),
),
],
const Divider(height: 8),
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(context.l10n.urlImage_enable),
+77 -27
View File
@@ -81,6 +81,8 @@ class _ContactsScreenState extends State<ContactsScreen> {
final List<_PendingContactOperation> _pendingOperations = [];
final DerivedListCache<Contact> _filteredCache = DerivedListCache<Contact>();
final Map<String, _ContactTileEntrance> _rowCache = {};
MeshCoreConnector? _rowCacheConnector;
StreamSubscription<Uint8List>? _frameSubscription;
@@ -1099,21 +1101,12 @@ class _ContactsScreenState extends State<ContactsScreen> {
itemBuilder: (context, row) {
if (row == 0) return discoveredTile;
final index = row - 1;
final contact = filteredAndSorted[index];
final unreadCount = connector.getUnreadCountForContact(
contact,
);
return _ContactTileEntrance(
index: index,
contact: contact,
pathHashByteWidth: connector.pathHashByteWidth,
lastSeen: resolveContactLastSeen(contact),
unreadCount: unreadCount,
isFavorite: contact.isFavorite,
onTap: () => _openChat(context, contact),
onLongPress: () =>
_showContactOptions(context, connector, contact),
onManage: _manageAction(context, contact),
return _contactRow(
context,
connector,
filteredAndSorted[index],
index,
filteredAndSorted.length,
);
},
),
@@ -1123,6 +1116,54 @@ class _ContactsScreenState extends State<ContactsScreen> {
);
}
/// Returns the row built last time for [contact] when nothing it shows has
/// changed. The connector notifies up to 20 times a second on a busy mesh
/// and each notify rebuilds this screen; handing the list the same widget
/// instance lets Flutter skip rebuilding those rows.
_ContactTileEntrance _contactRow(
BuildContext context,
MeshCoreConnector connector,
Contact contact,
int index,
int rowCount,
) {
if (!identical(_rowCacheConnector, connector)) {
_rowCache.clear();
_rowCacheConnector = connector;
}
final unreadCount = connector.getUnreadCountForContact(contact);
final pathHashByteWidth = connector.pathHashByteWidth;
// Relative ("5 mins ago"), so it can change while the contact does not.
final lastSeenLabel = formatContactLastSeen(
context.l10n,
resolveContactLastSeen(contact),
);
final cached = _rowCache[contact.publicKeyHex];
if (cached != null &&
identical(cached.contact, contact) &&
cached.index == index &&
cached.unreadCount == unreadCount &&
cached.pathHashByteWidth == pathHashByteWidth &&
cached.lastSeenLabel == lastSeenLabel) {
return cached;
}
// Drop rows of contacts that left the list now and then.
if (_rowCache.length > rowCount + 100) _rowCache.clear();
return _rowCache[contact.publicKeyHex] = _ContactTileEntrance(
index: index,
contact: contact,
pathHashByteWidth: pathHashByteWidth,
lastSeenLabel: lastSeenLabel,
unreadCount: unreadCount,
isFavorite: contact.isFavorite,
// The State's context: rows outlive the list's item context while the
// list is swapped for an empty state.
onTap: () => _openChat(this.context, contact),
onLongPress: () => _showContactOptions(this.context, connector, contact),
onManage: _manageAction(this.context, contact),
);
}
List<Contact> _filterAndSortContacts(
List<Contact> contacts,
MeshCoreConnector connector,
@@ -1156,7 +1197,8 @@ class _ContactsScreenState extends State<ContactsScreen> {
DateTime _lastMessageTime(MeshCoreConnector connector, Contact contact) {
final messages = connector.getMessages(contact);
return messages.isEmpty ? DateTime(1970) : messages.last.timestamp;
// Local arrival time: sender clocks can be far off.
return messages.isEmpty ? DateTime(1970) : messages.last.receivedAt;
}
List<Contact> _computeFilteredContacts(
@@ -1204,16 +1246,24 @@ class _ContactsScreenState extends State<ContactsScreen> {
switch (viewState.contactsSortOption) {
case ContactSortOption.lastSeen:
filtered.sort(
(a, b) =>
resolveContactLastSeen(b).compareTo(resolveContactLastSeen(a)),
);
final lastSeenAt = {
for (final c in filtered)
c: resolveContactLastSeen(
c,
addedAt: connector.contactAddedAt(c.publicKeyHex),
),
};
filtered.sort((a, b) => lastSeenAt[b]!.compareTo(lastSeenAt[a]!));
break;
case ContactSortOption.recentMessages:
final lastMessageAt = {
for (final c in filtered) c: _lastMessageTime(connector, c),
};
filtered.sort((a, b) => lastMessageAt[b]!.compareTo(lastMessageAt[a]!));
filtered.sort((a, b) {
final timeCompare = lastMessageAt[b]!.compareTo(lastMessageAt[a]!);
if (timeCompare != 0) return timeCompare;
return a.name.toLowerCase().compareTo(b.name.toLowerCase());
});
break;
case ContactSortOption.name:
filtered.sort(
@@ -1737,7 +1787,7 @@ void confirmRemoveContact(
class _ContactTile extends StatelessWidget {
final Contact contact;
final int pathHashByteWidth;
final DateTime lastSeen;
final String lastSeenLabel;
final int unreadCount;
final bool isFavorite;
final VoidCallback onTap;
@@ -1747,7 +1797,7 @@ class _ContactTile extends StatelessWidget {
const _ContactTile({
required this.contact,
required this.pathHashByteWidth,
required this.lastSeen,
required this.lastSeenLabel,
required this.unreadCount,
required this.isFavorite,
required this.onTap,
@@ -1879,7 +1929,7 @@ class _ContactTile extends StatelessWidget {
],
),
Text(
formatContactLastSeen(context.l10n, lastSeen),
lastSeenLabel,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: MeshTheme.mono(
@@ -1956,7 +2006,7 @@ class _ContactTileEntrance extends StatelessWidget {
final int index;
final Contact contact;
final int pathHashByteWidth;
final DateTime lastSeen;
final String lastSeenLabel;
final int unreadCount;
final bool isFavorite;
final VoidCallback onTap;
@@ -1967,7 +2017,7 @@ class _ContactTileEntrance extends StatelessWidget {
required this.index,
required this.contact,
required this.pathHashByteWidth,
required this.lastSeen,
required this.lastSeenLabel,
required this.unreadCount,
required this.isFavorite,
required this.onTap,
@@ -1982,7 +2032,7 @@ class _ContactTileEntrance extends StatelessWidget {
child: _ContactTile(
contact: contact,
pathHashByteWidth: pathHashByteWidth,
lastSeen: lastSeen,
lastSeenLabel: lastSeenLabel,
unreadCount: unreadCount,
isFavorite: isFavorite,
onTap: onTap,
+3 -1
View File
@@ -23,6 +23,7 @@ const String _encryptedBackupFormat = 'meshcore-open-encrypted-backup';
const List<String> _contactPreferencePrefixes = [
'contacts',
'contact_groups',
'contact_added_at_',
'contact_smaz_',
'contact_cyr2lat_',
'contact_url_images_',
@@ -1094,7 +1095,8 @@ class BackupService {
return true;
}
if (items.contains(BackupItem.contacts) &&
key.startsWith('contacts$devicePrefix')) {
(key.startsWith('contacts$devicePrefix') ||
key.startsWith('contact_added_at_$devicePrefix'))) {
return true;
}
if (items.contains(BackupItem.perContactSettings) &&
+24 -5
View File
@@ -871,14 +871,33 @@ class ImageCodecCancelled implements Exception {
String toString() => 'Image processing stopped.';
}
/// Whether this build can run the image codec at all.
///
/// False on web and in a build made with `scripts/onnx.sh off`, where
/// `flutter_onnxruntime` is the pure-Dart stub whose [OnnxRuntime] constructor
/// throws [UnsupportedError]. The real constructor has no side effects.
final bool imageCodecRuntimeAvailable = _probeOnnxRuntime();
bool _probeOnnxRuntime() {
if (kIsWeb) {
return false;
}
try {
OnnxRuntime();
return true;
} on UnsupportedError {
return false;
}
}
/// Factory used by the codec worker isolate.
///
/// Returns `null` on web, where there is no local model file and no isolate.
/// Everywhere else it returns the real [OnnxImageCodecBackend]; the session
/// turns a `null` here into an [ImageCodecUnimplemented], which the service
/// surfaces as `lastError` and maps to `ImageCodecAvailability.unavailable`.
/// Returns `null` when [imageCodecRuntimeAvailable] is false. Everywhere else
/// it returns the real [OnnxImageCodecBackend]; the session turns a `null`
/// here into an [ImageCodecUnimplemented], which the service surfaces as
/// `lastError` and maps to `ImageCodecAvailability.unavailable`.
ImageCodecBackend? createImageCodecBackend() {
if (kIsWeb) {
if (!imageCodecRuntimeAvailable) {
return null;
}
return OnnxImageCodecBackend();
+9 -3
View File
@@ -8,7 +8,8 @@ import '../models/image_codec_support.dart';
import '../utils/app_logger.dart';
import '../widgets/image_send_codec_binding.dart';
import 'app_settings_service.dart';
import 'image_codec_backend.dart' show kImageCodecBitstreamPathAvailable;
import 'image_codec_backend.dart'
show imageCodecRuntimeAvailable, kImageCodecBitstreamPathAvailable;
import 'image_codec_file_store.dart';
import 'image_codec_session.dart';
import 'image_codec_settings_store.dart';
@@ -177,9 +178,10 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
/// Why [availability] is `unavailable`, or null when it is not.
///
/// EXACTLY THREE CAUSES, all of them permanent properties of the build or the
/// EXACTLY FOUR CAUSES, all of them permanent properties of the build or the
/// platform, none of them fixable by the user:
/// * web, which has no native inference runtime;
/// * a build made without ONNX Runtime ([imageCodecRuntimeAvailable]);
/// * a build compiled without the entropy path
/// ([kImageCodecBitstreamPathAvailable]);
/// * a backend that failed to load.
@@ -194,6 +196,10 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
return 'The image codec needs a native inference runtime, which the web '
'build does not have.';
}
if (!imageCodecRuntimeAvailable) {
return 'This build was made without ONNX Runtime, so it cannot send or '
'show image messages.';
}
if (!kImageCodecBitstreamPathAvailable) {
return 'This build ships the image decoder only. Encoding and decoding a '
'bitstream also needs the entropy-side graph and the rANS coder, '
@@ -510,7 +516,7 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
/// works. [canEncode]/[canDecode] additionally require the entropy path.
bool get canRunInference {
final model = selectedModel;
return !kIsWeb &&
return imageCodecRuntimeAvailable &&
!_backendMissing &&
model != null &&
model.localPath.isNotEmpty;
+45
View File
@@ -0,0 +1,45 @@
import 'dart:convert';
import '../utils/app_logger.dart';
import 'prefs_manager.dart';
/// Phone time at which each contact was first added from a card, keyed by
/// contact public key hex. App-side only: the radio keeps advert time 0 for
/// these contacts, so this orders them until a real advert arrives.
class ContactAddedAtStore {
static const String _keyPrefix = 'contact_added_at_';
String publicKeyHex = '';
set setPublicKeyHex(String value) =>
publicKeyHex = value.length > 10 ? value.substring(0, 10) : '';
String get keyFor => '$_keyPrefix$publicKeyHex';
Map<String, DateTime> load() {
if (publicKeyHex.isEmpty) return {};
final jsonString = PrefsManager.instance.getString(keyFor);
if (jsonString == null || jsonString.isEmpty) return {};
try {
final decoded = jsonDecode(jsonString) as Map<String, dynamic>;
return {
for (final entry in decoded.entries)
if (entry.value is int)
entry.key: DateTime.fromMillisecondsSinceEpoch(entry.value as int),
};
} catch (e) {
appLogger.warn('Stored contact added times are unreadable: $e');
return {};
}
}
Future<void> save(Map<String, DateTime> addedAt) async {
if (publicKeyHex.isEmpty) return;
await PrefsManager.instance.setString(
keyFor,
jsonEncode({
for (final entry in addedAt.entries)
entry.key: entry.value.millisecondsSinceEpoch,
}),
);
}
}
+53 -26
View File
@@ -62,6 +62,14 @@ class ByteCountedTextField extends StatelessWidget {
final int? softLimitBytes;
final String? softLimitNote;
/// Lines the field grows to before it scrolls internally. Null (the
/// default) grows without limit.
final int? maxLines;
/// Show the counter row only once usage passes [warningThreshold], and give
/// it no space until then. By default the row keeps its height while hidden.
final bool counterOnlyNearLimit;
const ByteCountedTextField({
super.key,
required this.maxBytes,
@@ -80,6 +88,8 @@ class ByteCountedTextField extends StatelessWidget {
this.encoder,
this.softLimitBytes,
this.softLimitNote,
this.maxLines,
this.counterOnlyNearLimit = false,
});
@override
@@ -92,7 +102,9 @@ class ByteCountedTextField extends StatelessWidget {
: value.text;
final usedBytes = utf8.encode(effectiveText).length;
final ratio = maxBytes > 0 ? usedBytes / maxBytes : 0.0;
final showCounter = !(hideCounterWhenEmpty && value.text.isEmpty);
final showCounter = counterOnlyNearLimit
? ratio > warningThreshold
: !(hideCounterWhenEmpty && value.text.isEmpty);
final showSoftLimitNote =
softLimitNote != null &&
softLimitBytes != null &&
@@ -104,12 +116,27 @@ class ByteCountedTextField extends StatelessWidget {
? Theme.of(context).colorScheme.tertiary
: Theme.of(context).colorScheme.onSurfaceVariant;
final softNote = showSoftLimitNote
? Text(
softLimitNote!,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.tertiary,
),
)
: null;
final counter = Text(
'$usedBytes / $maxBytes',
style: TextStyle(fontSize: 12, color: counterColor),
);
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextField(
maxLines: null,
minLines: maxLines == null ? null : 1,
maxLines: maxLines,
controller: controller,
focusNode: focusNode,
autofocus: autofocus,
@@ -134,32 +161,32 @@ class ByteCountedTextField extends StatelessWidget {
textInputAction: textInputAction,
onSubmitted: onSubmitted,
),
Opacity(
opacity: showCounter ? 1 : 0,
child: Padding(
padding: const EdgeInsets.only(top: 4, right: 4),
child: Row(
children: [
Expanded(
child: showSoftLimitNote
? Text(
softLimitNote!,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.tertiary,
),
)
: const SizedBox.shrink(),
),
const SizedBox(width: 8),
Text(
'$usedBytes / $maxBytes',
style: TextStyle(fontSize: 12, color: counterColor),
),
],
if (counterOnlyNearLimit && showCounter)
// Right-aligned, and wraps rather than overflowing at large
// text sizes in a narrow field.
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 12, 8),
child: Wrap(
alignment: WrapAlignment.end,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 8,
children: [?softNote, counter],
),
)
else if (!counterOnlyNearLimit)
Opacity(
opacity: showCounter ? 1 : 0,
child: Padding(
padding: const EdgeInsets.only(top: 4, right: 4),
child: Row(
children: [
Expanded(child: softNote ?? const SizedBox.shrink()),
const SizedBox(width: 8),
counter,
],
),
),
),
),
],
);
},
+57 -4
View File
@@ -42,26 +42,79 @@ ChatBackgroundService? _maybeService(
}
/// Draws [chatKey]'s background (its own, or the theme's) behind [child].
///
/// A [footer] (the chat composer) sits below [child] over the same
/// background and can ask [ChatBackdrop.hasBackgroundOf] whether one is
/// drawn. [contentKey] marks the message area above the footer.
class ChatBackdrop extends StatelessWidget {
final String chatKey;
final Widget child;
final Widget? footer;
final Key? contentKey;
const ChatBackdrop({super.key, required this.chatKey, required this.child});
const ChatBackdrop({
super.key,
required this.chatKey,
required this.child,
this.footer,
this.contentKey,
});
/// Whether the nearest [ChatBackdrop] draws a background behind its footer.
static bool hasBackgroundOf(BuildContext context) =>
context
.dependOnInheritedWidgetOfExactType<_ChatBackdropScope>()
?.hasBackground ??
false;
@override
Widget build(BuildContext context) {
final background = _maybeService(context)?.resolve(chatKey);
if (background == null) return child;
final footer = this.footer;
if (footer == null) {
if (background == null) return child;
return Stack(
fit: StackFit.expand,
children: [
Positioned.fill(child: ChatBackgroundLayer(background: background)),
child,
],
);
}
return Stack(
fit: StackFit.expand,
children: [
Positioned.fill(child: ChatBackgroundLayer(background: background)),
child,
Positioned.fill(
child: background == null
? const SizedBox.shrink()
: ChatBackgroundLayer(background: background),
),
Column(
children: [
Expanded(
child: KeyedSubtree(key: contentKey, child: child),
),
_ChatBackdropScope(
hasBackground: background != null,
child: footer,
),
],
),
],
);
}
}
class _ChatBackdropScope extends InheritedWidget {
final bool hasBackground;
const _ChatBackdropScope({required this.hasBackground, required super.child});
@override
bool updateShouldNotify(_ChatBackdropScope oldWidget) =>
hasBackground != oldWidget.hasBackground;
}
/// Paints one [ChatBackground], faded toward the theme's surface color.
class ChatBackgroundLayer extends StatelessWidget {
final ChatBackground background;
+378 -149
View File
@@ -8,10 +8,12 @@ import '../services/app_settings_service.dart';
import '../theme/mesh_theme.dart';
import '../utils/radio_guard.dart';
import 'byte_count_input.dart';
import 'chat_background.dart';
import 'connect_sheet.dart';
import 'gif_message.dart';
import 'gif_picker.dart';
import 'mesh_ui.dart';
import 'message_bubble_frame.dart';
import 'message_translation_button.dart';
import '../theme/theme_icons.dart';
@@ -54,10 +56,60 @@ Future<void> showComposerTranslationOptions(BuildContext context) async {
);
}
/// The message composer shared by the direct and channel chat screens:
/// "+" action menu, optional translation toggle, byte-counted text field (or
/// GIF preview) and send button. [header] widgets (reply banner, progress)
/// are stacked above the row.
/// Corner radius of the compose bubble and the offline bar.
const double kComposerBubbleRadius = 20;
/// Lines the compose field grows to before it scrolls.
const int kComposerMaxLines = 5;
/// Fill of the compose bubble: the incoming-bubble colour over a chat
/// background so it stays readable, otherwise a raised surface.
Color composerBubbleColor(BuildContext context) {
return ChatBackdrop.hasBackgroundOf(context)
? MessageBubbleColors.of(context, isOutgoing: false).background
: Theme.of(context).colorScheme.surfaceContainerHigh;
}
/// The bottom panel holding the compose bubble: transparent over a chat
/// background, solid surface otherwise. 12dp side and 8dp vertical margins
/// (8dp on the trailing side, where the round button's touch target adds 2).
class _ComposerPanel extends StatelessWidget {
final List<Widget> header;
final Widget child;
const _ComposerPanel({this.header = const [], required this.child});
@override
Widget build(BuildContext context) {
final content = SafeArea(
top: false,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
...header,
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(12, 8, 10, 8),
child: child,
),
],
),
);
if (ChatBackdrop.hasBackgroundOf(context)) return content;
return ColoredBox(
color: Theme.of(context).colorScheme.surface,
child: content,
);
}
}
/// The message composer shared by the direct and channel chat screens.
///
/// A rounded compose bubble (optional [replyPreview], then the byte-counted
/// text field or a GIF preview, with the translation toggle on its right)
/// and one round button beside it: "+" (the [actionsBuilder] menu) while the
/// field is empty, Send once there is text. [header] widgets (e.g. image
/// send progress) are stacked full-width above the bubble.
class ChatComposer extends StatelessWidget {
final TextEditingController controller;
final FocusNode focusNode;
@@ -74,6 +126,12 @@ class ChatComposer extends StatelessWidget {
final ValueChanged<String> onAction;
final List<Widget> header;
/// Shown inside the top of the bubble, usually a [ChatComposerQuote].
final Widget? replyPreview;
/// Marks the compose bubble (and the offline bar's bubble).
static const bubbleKey = ValueKey('chat-composer-bubble');
const ChatComposer({
super.key,
required this.controller,
@@ -87,6 +145,7 @@ class ChatComposer extends StatelessWidget {
this.softLimitNote,
this.encoder,
this.header = const [],
this.replyPreview,
});
Future<void> _openActionMenu(BuildContext buttonContext) async {
@@ -128,7 +187,6 @@ class ChatComposer extends StatelessWidget {
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
// Offline the chat is read-only. The draft stays in [controller] (owned
// by the screen) and is back when the radio reconnects.
if (context.radioReadOnly) return const OfflineComposerBar();
@@ -140,26 +198,40 @@ class ChatComposer extends StatelessWidget {
s.settings.translationTargetLanguageCode,
),
);
return Container(
final scheme = Theme.of(context).colorScheme;
final replyPreview = this.replyPreview;
final bubble = DecoratedBox(
key: ChatComposer.bubbleKey,
decoration: BoxDecoration(
color: scheme.surface,
border: Border(top: BorderSide(color: scheme.outlineVariant, width: 1)),
color: composerBubbleColor(context),
borderRadius: BorderRadius.circular(kComposerBubbleRadius),
),
child: SafeArea(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
...header,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (replyPreview != null)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
padding: const EdgeInsets.fromLTRB(6, 6, 6, 0),
child: replyPreview,
),
ValueListenableBuilder<TextEditingValue>(
valueListenable: controller,
builder: (context, value, _) {
final gifId = GifHelper.parseGif(value.text);
if (gifId != null) {
return _buildGifPreview(context, gifId, scheme);
}
return Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Builder(
builder: (buttonContext) => IconButton(
icon: const Icon(Icons.add_circle_outline),
tooltip: context.l10n.chat_selectSendAction,
onPressed: () => _openActionMenu(buttonContext),
Expanded(
child: LayoutBuilder(
builder: (context, constraints) => _buildTextField(
context,
scheme,
constraints.maxHeight,
),
),
),
if (translation.$1)
@@ -168,50 +240,34 @@ class ChatComposer extends StatelessWidget {
languageCode: translation.$3,
onPressed: () => showComposerTranslationOptions(context),
),
Expanded(
child: ValueListenableBuilder<TextEditingValue>(
valueListenable: controller,
builder: (context, value, _) {
final gifId = GifHelper.parseGif(value.text);
if (gifId != null) {
return _buildGifPreview(context, gifId, scheme);
}
return _buildTextField(context, scheme);
},
),
),
const SizedBox(width: 6),
ValueListenableBuilder<TextEditingValue>(
valueListenable: controller,
builder: (context, value, _) {
final hasText = value.text.trim().isNotEmpty;
return IconButton.filled(
icon: const ThemedIcon(ThemeIconSlot.send, size: 20),
tooltip: sendTooltip,
style: IconButton.styleFrom(
backgroundColor: hasText
? scheme.primary
: scheme.surfaceContainerHighest,
foregroundColor: hasText
? scheme.onPrimary
: scheme.onSurfaceVariant,
minimumSize: const Size(40, 40),
shape: const CircleBorder(),
),
onPressed: hasText
? () {
HapticFeedback.lightImpact();
onSend();
}
: null,
);
},
),
],
),
);
},
),
],
),
);
return _ComposerPanel(
header: header,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child: bubble),
const SizedBox(width: 4),
ValueListenableBuilder<TextEditingValue>(
valueListenable: controller,
builder: (context, value, _) => _ComposerRoundButton(
hasText: value.text.trim().isNotEmpty,
sendTooltip: sendTooltip,
actionsTooltip: context.l10n.chat_selectSendAction,
onSend: () {
HapticFeedback.lightImpact();
onSend();
},
onOpenActions: _openActionMenu,
),
],
),
),
],
),
);
}
@@ -232,39 +288,57 @@ class ChatComposer extends StatelessWidget {
}
return KeyEventResult.ignored;
},
child: Row(
children: [
Expanded(
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: GifMessage(
url: 'https://media.giphy.com/media/$gifId/giphy.gif',
backgroundColor: scheme.surfaceContainerHighest,
fallbackTextColor: scheme.onSurface.withValues(alpha: 0.6),
maxSize: 160,
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(8, 8, 0, 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Align(
alignment: AlignmentDirectional.centerStart,
child: ClipRRect(
borderRadius: BorderRadius.circular(MeshRadii.md),
child: GifMessage(
url: 'https://media.giphy.com/media/$gifId/giphy.gif',
backgroundColor: scheme.surfaceContainerHighest,
fallbackTextColor: scheme.onSurfaceVariant,
maxSize: 160,
),
),
),
),
),
const SizedBox(width: 8),
IconButton(
icon: const Icon(Icons.close),
tooltip: context.l10n.chat_removeGif,
onPressed: () {
controller.clear();
focusNode.requestFocus();
},
),
],
IconButton(
icon: const Icon(Icons.close),
tooltip: context.l10n.chat_removeGif,
onPressed: () {
controller.clear();
focusNode.requestFocus();
},
),
],
),
),
);
}
Widget _buildTextField(BuildContext context, ColorScheme scheme) {
OutlineInputBorder border(Color color, [double width = 1]) =>
OutlineInputBorder(
borderRadius: BorderRadius.circular(MeshRadii.md),
borderSide: BorderSide(color: color, width: width),
);
/// [maxHeight] is the room the chat leaves the composer: above the
/// keyboard, since the screen's body resizes for it.
Widget _buildTextField(
BuildContext context,
ColorScheme scheme,
double maxHeight,
) {
// Five lines, or fewer when large text and a short window leave little
// room, so the field takes no more than about a quarter of the chat.
// Never one line: that stops wrapping and the keyboard's newline key.
final room = maxHeight.isFinite
? maxHeight
: MediaQuery.sizeOf(context).height;
final lineHeight = MediaQuery.textScalerOf(context).scale(16) * 1.5;
final maxLines = (room / 4 / lineHeight).floor().clamp(
2,
kComposerMaxLines,
);
return ByteCountedTextField(
maxBytes: maxBytes,
softLimitBytes: softLimitBytes,
@@ -274,85 +348,240 @@ class ChatComposer extends StatelessWidget {
hintText: context.l10n.chat_typeMessage,
onSubmitted: (_) => onSend(),
encoder: encoder,
maxLines: maxLines,
counterOnlyNearLimit: true,
decoration: InputDecoration(
hintText: context.l10n.chat_typeMessage,
border: border(scheme.outlineVariant),
enabledBorder: border(scheme.outlineVariant),
focusedBorder: border(scheme.primary, 1.5),
filled: true,
fillColor: scheme.surfaceContainerLow,
contentPadding: const EdgeInsets.symmetric(
horizontal: 18,
vertical: 12,
),
hintStyle: TextStyle(color: scheme.onSurfaceVariant),
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
filled: false,
isDense: true,
// A 24dp line plus 12 above and below: 48dp on one line, level with
// the round button beside the bubble.
contentPadding: const EdgeInsetsDirectional.fromSTEB(16, 12, 8, 12),
),
);
}
}
/// Stands in for the composer while no radio is connected.
class OfflineComposerBar extends StatelessWidget {
const OfflineComposerBar({super.key});
/// The round button beside the compose bubble: "+" while the field is
/// empty, Send once there is text. Drawn at 44dp in a 48dp touch target.
class _ComposerRoundButton extends StatelessWidget {
final bool hasText;
final String sendTooltip;
final String actionsTooltip;
final VoidCallback onSend;
final ValueChanged<BuildContext> onOpenActions;
const _ComposerRoundButton({
required this.hasText,
required this.sendTooltip,
required this.actionsTooltip,
required this.onSend,
required this.onOpenActions,
});
static const _visualSize = Size(44, 44);
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Container(
decoration: BoxDecoration(
color: scheme.surfaceContainerLow,
border: Border(top: BorderSide(color: scheme.outlineVariant, width: 1)),
ButtonStyle style(Color background, Color foreground) =>
IconButton.styleFrom(
backgroundColor: background,
foregroundColor: foreground,
fixedSize: _visualSize,
minimumSize: _visualSize,
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.padded,
shape: const CircleBorder(),
);
final Widget button = hasText
? IconButton.filled(
key: const ValueKey('composer-send'),
icon: const ThemedIcon(ThemeIconSlot.send, size: 22),
tooltip: sendTooltip,
style: style(scheme.primary, scheme.onPrimary),
onPressed: onSend,
)
: Builder(
key: const ValueKey('composer-actions'),
builder: (buttonContext) => IconButton.filled(
icon: const Icon(Icons.add, size: 28),
tooltip: actionsTooltip,
style: style(composerBubbleColor(context), scheme.onSurface),
onPressed: () => onOpenActions(buttonContext),
),
);
return SizedBox.square(
dimension: kMinInteractiveDimension,
child: AnimatedSwitcher(
duration: MediaQuery.disableAnimationsOf(context)
? Duration.zero
: const Duration(milliseconds: 150),
transitionBuilder: (child, animation) => FadeTransition(
opacity: animation,
child: ScaleTransition(
scale: Tween<double>(begin: 0.6, end: 1).animate(animation),
child: child,
),
),
child: button,
),
child: SafeArea(
);
}
}
/// A quoted message inside the top of the compose bubble ("Replying to
/// Bob"): a coloured bar on the leading edge, [title], [content], optional
/// [trailing] controls and a dismiss button.
class ChatComposerQuote extends StatelessWidget {
final String title;
final Widget content;
final Widget? trailing;
final VoidCallback onDismiss;
final String dismissTooltip;
const ChatComposerQuote({
super.key,
required this.title,
required this.content,
required this.onDismiss,
required this.dismissTooltip,
this.trailing,
});
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
final background = scheme.surfaceContainerHighest;
final accent = readableAccent(scheme.primary, background);
final trailing = this.trailing;
return ClipRRect(
borderRadius: BorderRadius.circular(MeshRadii.md),
child: DecoratedBox(
decoration: BoxDecoration(
color: background,
border: BorderDirectional(start: BorderSide(color: accent, width: 4)),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 10, 12, 10),
padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 0, 6),
child: LayoutBuilder(
builder: (context, constraints) {
final message = Row(
children: [
Icon(
Icons.cloud_off,
color: scheme.onSurfaceVariant,
size: 24,
builder: (context, constraints) => Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w700,
color: accent,
),
),
content,
],
),
const SizedBox(width: 12),
Expanded(
child: Text(
context.l10n.chat_composerOffline,
style: Theme.of(
context,
).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
),
// The quote shares its row with Send, so a long trailing
// control (a region chip) must not squeeze out the message
// or the dismiss button.
if (trailing != null)
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth * 0.4,
),
child: trailing,
),
],
);
// Side by side when there is room; otherwise the button goes
// under the message so large text never squeezes it.
final roomy =
constraints.maxWidth /
MediaQuery.textScalerOf(context).scale(1) >=
420;
if (roomy) {
return Row(
children: [
Expanded(child: message),
const SizedBox(width: 8),
const ConnectButton(),
],
);
}
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
message,
const SizedBox(height: 8),
const ConnectButton(),
],
);
},
IconButton(
icon: const Icon(Icons.close),
tooltip: dismissTooltip,
color: scheme.onSurfaceVariant,
onPressed: onDismiss,
),
],
),
),
),
),
);
}
}
/// Stands in for the composer while no radio is connected, in the same
/// bubble and margins so the chat doesn't jump on connect or disconnect.
class OfflineComposerBar extends StatelessWidget {
const OfflineComposerBar({super.key});
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
final message = ConstrainedBox(
constraints: const BoxConstraints(minHeight: kMinInteractiveDimension),
child: DecoratedBox(
key: ChatComposer.bubbleKey,
decoration: BoxDecoration(
color: composerBubbleColor(context),
borderRadius: BorderRadius.circular(kComposerBubbleRadius),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
children: [
Icon(Icons.cloud_off, color: scheme.onSurfaceVariant, size: 24),
const SizedBox(width: 12),
Expanded(
child: Text(
context.l10n.chat_composerOffline,
style: Theme.of(
context,
).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
),
),
],
),
),
),
);
return _ComposerPanel(
child: LayoutBuilder(
builder: (context, constraints) {
// Side by side when there is room; otherwise the button goes
// under the message so large text never squeezes it.
final roomy =
constraints.maxWidth /
MediaQuery.textScalerOf(context).scale(1) >=
420;
if (roomy) {
return Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child: message),
const SizedBox(width: 4),
const ConnectButton(),
],
);
}
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
message,
const SizedBox(height: 8),
const Align(
alignment: AlignmentDirectional.centerEnd,
child: ConnectButton(),
),
],
);
},
),
);
}
}
+364
View File
@@ -0,0 +1,364 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import '../l10n/l10n.dart';
import '../models/app_settings.dart';
import '../models/chat_compression_mode.dart';
import '../theme/mesh_theme.dart';
import 'mesh_nav_tile.dart';
import 'mesh_ui.dart';
export '../models/chat_compression_mode.dart';
/// Always-visible "Compression: Off / SMAZ / Cyr2Lat" strip for the top of a
/// DM or channel chat. Tapping it opens one sheet with the three choices,
/// what each does, and the Cyr2Lat profile picker.
///
/// The parent supplies the saved state and persists changes through the
/// callbacks; this widget only shows a new mode once the parent rebuilds it
/// with that mode. A callback that throws leaves the saved mode in place and
/// shows an error in the sheet.
class ChatCompressionSelector extends StatefulWidget {
final ChatCompressionMode mode;
/// False disables the strip and the sheet; [disabledReason] says why.
final bool enabled;
final String? disabledReason;
final List<Cyr2LatProfile> profiles;
/// The Cyr2Lat profile saved for this chat, if any.
final String? profileId;
/// The app-wide profile, which sending uses when [profileId] is unset or
/// no longer exists.
final String? defaultProfileId;
final Future<void> Function(ChatCompressionMode mode) onModeChanged;
final Future<void> Function(String profileId) onProfileChanged;
const ChatCompressionSelector({
super.key,
required this.mode,
required this.enabled,
this.disabledReason,
required this.profiles,
required this.profileId,
this.defaultProfileId,
required this.onModeChanged,
required this.onProfileChanged,
});
/// The profile sending actually uses, matching the connector's fallback.
String? get effectiveProfileId {
bool known(String? id) => profiles.any((p) => p.id == id);
if (known(profileId)) return profileId;
if (known(defaultProfileId)) return defaultProfileId;
return profiles.isEmpty ? null : profiles.first.id;
}
@override
State<ChatCompressionSelector> createState() =>
_ChatCompressionSelectorState();
}
String chatCompressionModeLabel(BuildContext context, ChatCompressionMode m) {
final l10n = context.l10n;
return switch (m) {
ChatCompressionMode.off => l10n.chatCompression_off,
ChatCompressionMode.smaz => l10n.chatCompression_smaz,
ChatCompressionMode.cyr2lat => l10n.chatCompression_cyr2lat,
};
}
/// What the open sheet renders. The sheet is a separate route, so it listens
/// to this instead of rebuilding with the strip.
class _SelectorView {
final ChatCompressionMode mode;
final bool enabled;
final List<Cyr2LatProfile> profiles;
final String? profileId;
final bool busy;
final bool failed;
/// Counts failed saves, so the profile picker drops an unsaved choice.
final int failures;
const _SelectorView({
required this.mode,
required this.enabled,
required this.profiles,
required this.profileId,
required this.busy,
required this.failed,
required this.failures,
});
}
class _ChatCompressionSelectorState extends State<ChatCompressionSelector> {
late final ValueNotifier<_SelectorView> _view = ValueNotifier(_snapshot());
bool _busy = false;
bool _failed = false;
int _failures = 0;
_SelectorView _snapshot() => _SelectorView(
mode: widget.mode,
enabled: widget.enabled,
profiles: widget.profiles,
profileId: widget.effectiveProfileId,
busy: _busy,
failed: _failed,
failures: _failures,
);
@override
void didUpdateWidget(covariant ChatCompressionSelector oldWidget) {
super.didUpdateWidget(oldWidget);
// The sheet route is not below this widget, so it can't be marked dirty
// during this build.
SchedulerBinding.instance.addPostFrameCallback((_) {
if (mounted) _view.value = _snapshot();
});
}
@override
void dispose() {
_view.dispose();
super.dispose();
}
void _setBusy(bool busy, {required bool failed}) {
setState(() {
_busy = busy;
_failed = failed;
if (failed) _failures++;
});
_view.value = _snapshot();
}
/// Runs one save; returns whether it succeeded.
Future<bool> _save(Future<void> Function() write) async {
if (_busy || !widget.enabled) return false;
_setBusy(true, failed: false);
var ok = false;
try {
await write();
ok = true;
} catch (e) {
debugPrint('[ChatCompressionSelector] save failed: $e');
}
if (mounted) _setBusy(false, failed: !ok);
return ok;
}
Future<void> _openSheet() async {
if (_failed) _setBusy(false, failed: false);
await showMeshSheet<void>(
context,
builder: (sheetContext) => ValueListenableBuilder<_SelectorView>(
valueListenable: _view,
builder: (sheetContext, view, _) => _buildSheet(sheetContext, view),
),
);
}
Widget _buildSheet(BuildContext context, _SelectorView view) {
final l10n = context.l10n;
final scheme = Theme.of(context).colorScheme;
final canChange = view.enabled && !view.busy;
MeshSheetOption option(ChatCompressionMode mode, String description) {
return MeshSheetOption(
label: chatCompressionModeLabel(context, mode),
subtitle: description,
selected: view.mode == mode,
onTap: canChange
? () async {
final ok = await _save(() => widget.onModeChanged(mode));
// Cyr2Lat stays open so its profile can be picked.
if (ok && mode != ChatCompressionMode.cyr2lat) {
if (context.mounted) Navigator.of(context).maybePop();
}
}
: null,
);
}
final profileValue = view.profileId;
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHeader(
title: l10n.chatCompression_title,
subtitle: l10n.chatCompression_sheetSubtitle,
trailing: view.busy
? const Padding(
padding: EdgeInsets.all(8),
child: SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(strokeWidth: 2),
),
)
: null,
),
Flexible(
child: SingleChildScrollView(
padding: const EdgeInsets.only(bottom: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (view.failed)
Container(
margin: const EdgeInsets.fromLTRB(16, 8, 16, 8),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: scheme.errorContainer,
borderRadius: BorderRadius.circular(MeshRadii.sm),
),
child: Row(
children: [
Icon(
Icons.error_outline,
color: scheme.onErrorContainer,
),
const SizedBox(width: 12),
Expanded(
child: Text(
l10n.chatCompression_saveFailed,
style: Theme.of(context).textTheme.bodyMedium
?.copyWith(color: scheme.onErrorContainer),
),
),
],
),
),
if (!view.enabled && widget.disabledReason != null)
Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
child: Text(
widget.disabledReason!,
style: Theme.of(context).textTheme.bodyMedium,
),
),
option(
ChatCompressionMode.off,
l10n.chatCompression_offDescription,
),
option(
ChatCompressionMode.smaz,
l10n.chatCompression_smazDescription,
),
option(
ChatCompressionMode.cyr2lat,
l10n.chatCompression_cyr2latDescription,
),
if (view.mode == ChatCompressionMode.cyr2lat &&
view.profiles.isNotEmpty)
Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
child: DropdownButtonFormField<String>(
// The field keeps a picked value internally, so rebuild
// it with the saved value after a change or a failure.
key: ValueKey('$profileValue#${view.failures}'),
isExpanded: true,
initialValue: profileValue,
decoration: InputDecoration(
labelText: l10n.chatCompression_profile,
border: const OutlineInputBorder(),
),
items: [
for (final profile in view.profiles)
DropdownMenuItem(
value: profile.id,
child: Text(
profile.name,
overflow: TextOverflow.ellipsis,
),
),
],
onChanged: canChange
? (id) {
if (id == null || id == profileValue) return;
_save(() => widget.onProfileChanged(id));
}
: null,
),
),
],
),
),
),
],
);
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final scheme = theme.colorScheme;
final l10n = context.l10n;
final label = l10n.chatCompression_label(
chatCompressionModeLabel(context, widget.mode),
);
final reason = widget.enabled ? null : widget.disabledReason;
// One short row: the chat already leaves little room for messages at
// large text sizes, so a disabled strip explains itself in the sheet.
return Material(
color: scheme.surfaceContainerLow,
child: DecoratedBox(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: scheme.outlineVariant)),
),
child: MergeSemantics(
child: Semantics(
button: true,
enabled: !_busy,
label: reason == null ? label : '$label. $reason',
hint: l10n.chatCompression_changeHint,
child: InkWell(
onTap: _busy ? null : _openSheet,
child: ExcludeSemantics(
child: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 48),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
children: [
Flexible(
child: Text(
label,
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: scheme.onSurface,
),
),
),
const SizedBox(width: 4),
if (_busy)
const SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(strokeWidth: 2),
)
else
Icon(
widget.enabled
? Icons.arrow_drop_down
: Icons.lock_outline,
color: scheme.onSurfaceVariant,
),
],
),
),
),
),
),
),
),
),
);
}
}
+10 -2
View File
@@ -43,14 +43,22 @@ ThemeIconSlot? contactTypeIconSlot(int type) {
/// The most recent activity for [contact]: for chat nodes this includes the
/// last message, for other node types only the last advert or telemetry fix.
DateTime resolveContactLastSeen(Contact contact) {
final heard = contact.lastHeard;
/// [addedAt] (the phone time the contact was added from a card) stands in
/// while the radio has no advert time for it.
DateTime resolveContactLastSeen(Contact contact, {DateTime? addedAt}) {
final heard =
addedAt != null &&
contact.lastSeen.millisecondsSinceEpoch == 0 &&
addedAt.isAfter(contact.lastHeard)
? addedAt
: contact.lastHeard;
if (contact.type != advTypeChat) return heard;
return contact.lastMessageAt.isAfter(heard) ? contact.lastMessageAt : heard;
}
/// Short relative "last seen" label ("now", "5 mins ago", "2 days ago").
String formatContactLastSeen(AppLocalizations l10n, DateTime lastSeen) {
if (lastSeen.millisecondsSinceEpoch == 0) return l10n.contacts_lastSeenNever;
final diff = DateTime.now().difference(lastSeen);
if (diff.isNegative || diff.inMinutes < 5) {
+21 -8
View File
@@ -119,14 +119,18 @@ class MeshNavTile extends StatelessWidget {
}
/// One radio-style option row inside a bottom sheet picker.
/// The selected row shows a filled radio icon and a bold title, so the
/// choice never depends on colour alone. A null [onTap] disables the row.
class MeshSheetOption extends StatelessWidget {
final String label;
final String? subtitle;
final bool selected;
final VoidCallback onTap;
final VoidCallback? onTap;
const MeshSheetOption({
super.key,
required this.label,
this.subtitle,
required this.selected,
required this.onTap,
});
@@ -134,14 +138,23 @@ class MeshSheetOption extends StatelessWidget {
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return ListTile(
leading: Icon(
selected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
size: 24,
color: selected ? scheme.primary : scheme.onSurfaceVariant,
return Semantics(
selected: selected,
inMutuallyExclusiveGroup: true,
child: ListTile(
leading: Icon(
selected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
size: 24,
color: selected ? scheme.primary : scheme.onSurfaceVariant,
),
title: Text(
label,
style: selected ? const TextStyle(fontWeight: FontWeight.w700) : null,
),
subtitle: subtitle == null ? null : Text(subtitle!),
enabled: onTap != null,
onTap: onTap,
),
title: Text(label),
onTap: onTap,
);
}
}
+31 -11
View File
@@ -699,6 +699,11 @@ class ErrorRetryCard extends StatelessWidget {
/// Staggered fade + slide entrance for list items. Wrap each item and pass
/// its [index]; animation only plays once per widget lifecycle.
///
/// Only rows built while their list is at rest at the top play it. Rows that
/// a scroll brings into view appear at once: a delayed fade there leaves
/// blank rows trailing the finger and adds a ticker and an opacity layer per
/// row during a fling.
class ListEntrance extends StatefulWidget {
final int index;
final Widget child;
@@ -711,41 +716,56 @@ class ListEntrance extends StatefulWidget {
class _ListEntranceState extends State<ListEntrance>
with SingleTickerProviderStateMixin {
// Created eagerly: a lazy `late final` initializer would run on first
// access — which can be dispose(), where ticker creation throws.
late final AnimationController _controller;
late final CurvedAnimation _curve;
// Created in initState, not lazily: a lazy initializer would run on first
// access — which can be dispose(), where ticker creation throws. Null when
// the row skips the entrance.
AnimationController? _controller;
CurvedAnimation? _curve;
/// Whether the enclosing list has scrolled away from the top or is moving,
/// i.e. this row is entering because of a scroll.
bool _enteredByScroll() {
final scrollable = context.findAncestorStateOfType<ScrollableState>();
if (scrollable == null) return false;
final position = scrollable.position;
return position.isScrollingNotifier.value ||
(position.hasPixels && position.pixels != 0);
}
@override
void initState() {
super.initState();
_controller = AnimationController(
// Decided once: changing the tree shape later would rebuild the row.
if (_enteredByScroll()) return;
final controller = _controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 280),
);
_curve = CurvedAnimation(parent: _controller, curve: Curves.easeOutCubic);
_curve = CurvedAnimation(parent: controller, curve: Curves.easeOutCubic);
final delay = Duration(milliseconds: 24 * widget.index.clamp(0, 12));
Future.delayed(delay, () {
if (mounted) _controller.forward();
if (mounted) controller.forward();
});
}
@override
void dispose() {
_curve.dispose();
_controller.dispose();
_curve?.dispose();
_controller?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final curve = _curve;
if (curve == null) return widget.child;
return FadeTransition(
opacity: _curve,
opacity: curve,
child: SlideTransition(
position: Tween(
begin: const Offset(0, 0.04),
end: Offset.zero,
).animate(_curve),
).animate(curve),
child: widget.child,
),
);