Merge commit 'refs/pull/379/head' of https://github.com/zjs81/meshcore-open into test-regions

This commit is contained in:
HDDen
2026-05-31 00:06:16 +03:00
33 changed files with 1710 additions and 47 deletions
+22
View File
@@ -367,15 +367,32 @@ class _ChannelsScreenState extends State<ChannelsScreen>
_communityIndex,
);
final bool isCommunityChannel = Channel.isCommunityChannel(channelType);
final community = isCommunityChannel
? _communityIndex.getCommunityForChannel(channel)
: null;
final region = connector.hasChannelRegion(channel.index)
? context.l10n.channels_regionSetTo(
connector.getChannelRegion(channel.index),
)
: context.l10n.channels_regionNotSet;
String subtitle = region;
switch (channelType) {
case ChannelType.communityPublic:
icon = Icons.groups;
iconColor = Colors.purple;
bgColor = Colors.purple.withValues(alpha: 0.2);
if (community != null) {
subtitle =
'${context.l10n.community_publicChannel}${community.name}';
}
case ChannelType.communityHashtag:
icon = Icons.tag;
iconColor = Colors.purple;
bgColor = Colors.purple.withValues(alpha: 0.2);
if (community != null) {
subtitle =
'${context.l10n.community_hashtagChannel}${community.name}';
}
case ChannelType.public:
icon = Icons.public;
iconColor = Colors.green;
@@ -446,6 +463,11 @@ class _ChannelsScreenState extends State<ChannelsScreen>
: channel.name,
style: const TextStyle(fontWeight: FontWeight.w500),
),
subtitle: Text(
subtitle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [