mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-04-20 22:13:48 +00:00
fix: replace RadioListTile with RadioGroup for better state management in community selection
This commit is contained in:
parent
20171c491f
commit
297e609b3e
1 changed files with 27 additions and 26 deletions
|
|
@ -900,41 +900,42 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
|||
children: [
|
||||
// Only show type selection if user has communities
|
||||
if (_communities.isNotEmpty) ...[
|
||||
RadioListTile<bool>(
|
||||
value: true,
|
||||
RadioGroup<bool>(
|
||||
groupValue: isRegularHashtag,
|
||||
onChanged: (v) => setDialogState(() {
|
||||
isRegularHashtag = v!;
|
||||
if (v == null) return;
|
||||
isRegularHashtag = v;
|
||||
if (isRegularHashtag) {
|
||||
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 &&
|
||||
} else if (selectedCommunity == null &&
|
||||
_communities.isNotEmpty) {
|
||||
selectedCommunity = _communities.first;
|
||||
}
|
||||
}),
|
||||
title: Text(
|
||||
dialogContext.l10n.community_communityHashtag,
|
||||
child: Column(
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue