mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-08-01 16:15:56 +10:00
fix: replace RadioListTile with RadioGroup for better state management in community selection
This commit is contained in:
@@ -900,15 +900,22 @@ 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 &&
|
||||||
|
_communities.isNotEmpty) {
|
||||||
|
selectedCommunity = _communities.first;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
RadioListTile<bool>(
|
||||||
|
value: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
dialogContext.l10n.community_regularHashtag,
|
dialogContext.l10n.community_regularHashtag,
|
||||||
),
|
),
|
||||||
@@ -919,15 +926,6 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
|||||||
),
|
),
|
||||||
RadioListTile<bool>(
|
RadioListTile<bool>(
|
||||||
value: false,
|
value: false,
|
||||||
groupValue: isRegularHashtag,
|
|
||||||
onChanged: (v) => setDialogState(() {
|
|
||||||
isRegularHashtag = v!;
|
|
||||||
if (!isRegularHashtag &&
|
|
||||||
selectedCommunity == null &&
|
|
||||||
_communities.isNotEmpty) {
|
|
||||||
selectedCommunity = _communities.first;
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
title: Text(
|
title: Text(
|
||||||
dialogContext.l10n.community_communityHashtag,
|
dialogContext.l10n.community_communityHashtag,
|
||||||
),
|
),
|
||||||
@@ -937,6 +935,9 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
|||||||
dense: true,
|
dense: true,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
// Community dropdown (only if community hashtag selected)
|
// Community dropdown (only if community hashtag selected)
|
||||||
if (!isRegularHashtag && _communities.isNotEmpty)
|
if (!isRegularHashtag && _communities.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
|
|||||||
Reference in New Issue
Block a user