mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-20 07:41:03 +10:00
fix: replace RadioListTile with RadioGroup for better state management in community selection
This commit is contained in:
@@ -900,41 +900,42 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
|||||||
children: [
|
children: [
|
||||||
// Only show type selection if user has communities
|
// Only show type selection if user has communities
|
||||||
if (_communities.isNotEmpty) ...[
|
if (_communities.isNotEmpty) ...[
|
||||||
RadioListTile<bool>(
|
RadioGroup<bool>(
|
||||||
value: true,
|
|
||||||
groupValue: isRegularHashtag,
|
groupValue: isRegularHashtag,
|
||||||
onChanged: (v) => setDialogState(() {
|
onChanged: (v) => setDialogState(() {
|
||||||
isRegularHashtag = v!;
|
if (v == null) return;
|
||||||
|
isRegularHashtag = v;
|
||||||
if (isRegularHashtag) {
|
if (isRegularHashtag) {
|
||||||
selectedCommunity = null;
|
selectedCommunity = null;
|
||||||
}
|
} else if (selectedCommunity == null &&
|
||||||
}),
|
|
||||||
title: Text(
|
|
||||||
dialogContext.l10n.community_regularHashtag,
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
dialogContext.l10n.community_regularHashtagDesc,
|
|
||||||
),
|
|
||||||
dense: true,
|
|
||||||
),
|
|
||||||
RadioListTile<bool>(
|
|
||||||
value: false,
|
|
||||||
groupValue: isRegularHashtag,
|
|
||||||
onChanged: (v) => setDialogState(() {
|
|
||||||
isRegularHashtag = v!;
|
|
||||||
if (!isRegularHashtag &&
|
|
||||||
selectedCommunity == null &&
|
|
||||||
_communities.isNotEmpty) {
|
_communities.isNotEmpty) {
|
||||||
selectedCommunity = _communities.first;
|
selectedCommunity = _communities.first;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
title: Text(
|
child: Column(
|
||||||
dialogContext.l10n.community_communityHashtag,
|
children: [
|
||||||
|
RadioListTile<bool>(
|
||||||
|
value: true,
|
||||||
|
title: Text(
|
||||||
|
dialogContext.l10n.community_regularHashtag,
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
dialogContext.l10n.community_regularHashtagDesc,
|
||||||
|
),
|
||||||
|
dense: true,
|
||||||
|
),
|
||||||
|
RadioListTile<bool>(
|
||||||
|
value: false,
|
||||||
|
title: Text(
|
||||||
|
dialogContext.l10n.community_communityHashtag,
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
dialogContext.l10n.community_communityHashtagDesc,
|
||||||
|
),
|
||||||
|
dense: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
|
||||||
dialogContext.l10n.community_communityHashtagDesc,
|
|
||||||
),
|
|
||||||
dense: true,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
// Community dropdown (only if community hashtag selected)
|
// Community dropdown (only if community hashtag selected)
|
||||||
|
|||||||
Reference in New Issue
Block a user