Ripristina scelta visibilità con due pulsanti segmentati in app.

Pubblico (default) e privato/non in elenco, stessa logica di prima.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 23:03:56 +02:00
parent 1677df7f86
commit 787161807c

View File

@@ -30,7 +30,7 @@ class StepTransmission extends ConsumerStatefulWidget {
class _StepTransmissionState extends ConsumerState<StepTransmission> { class _StepTransmissionState extends ConsumerState<StepTransmission> {
String _platform = 'matchlivetv'; String _platform = 'matchlivetv';
bool _linkOnly = false; String _privacy = 'public';
String? _youtubeChannel; String? _youtubeChannel;
bool _creating = false; bool _creating = false;
@@ -60,7 +60,7 @@ class _StepTransmissionState extends ConsumerState<StepTransmission> {
widget.match.id, widget.match.id,
platform: _platform, platform: _platform,
youtubeChannel: _platform == 'youtube' ? _youtubeChannel : null, youtubeChannel: _platform == 'youtube' ? _youtubeChannel : null,
privacyStatus: _linkOnly ? 'unlisted' : 'public', privacyStatus: _privacy,
qualityPreset: '720p_30_2.5mbps', qualityPreset: '720p_30_2.5mbps',
targetBitrate: 2500000, targetBitrate: 2500000,
targetFps: 30, targetFps: 30,
@@ -216,23 +216,32 @@ class _StepTransmissionState extends ConsumerState<StepTransmission> {
Text('Visibilità', style: theme.textTheme.titleLarge), Text('Visibilità', style: theme.textTheme.titleLarge),
const SizedBox(height: 8), const SizedBox(height: 8),
Text( Text(
'Vale per Match Live TV e YouTube (canale nostro o della società). ' 'Match Live TV e YouTube (canale nostro o società).',
'Di default la diretta è pubblica.',
style: theme.textTheme.bodySmall, style: theme.textTheme.bodySmall,
), ),
const SizedBox(height: 12),
SegmentedButton<String>(
segments: const [
ButtonSegment(
value: 'public',
label: Text('Pubblico'),
icon: Icon(Icons.public),
),
ButtonSegment(
value: 'unlisted',
label: Text('Privato / non in elenco'),
icon: Icon(Icons.link),
),
],
selected: {_privacy},
onSelectionChanged: (s) => setState(() => _privacy = s.first),
),
const SizedBox(height: 8), const SizedBox(height: 8),
SwitchListTile( Text(
contentPadding: EdgeInsets.zero, _privacy == 'public'
value: _linkOnly, ? 'Compare nell\'elenco dirette e sul canale YouTube scelto.'
onChanged: (v) => setState(() => _linkOnly = v), : 'Solo chi ha il link. Non in elenco pubblico né nelle ricerche.',
title: const Text('Privato / non in elenco'), style: theme.textTheme.bodySmall?.copyWith(color: AppTheme.textSecondary),
subtitle: Text(
_platform == 'matchlivetv'
? 'Non compare nell\'elenco dirette del sito. Solo chi ha il link.'
: _platform == 'youtube'
? 'Non compare su YouTube in ricerca o nel canale. Solo chi ha il link.'
: 'Visibile solo a chi ha il link, non in elenco pubblico.',
),
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
Text('Qualità', style: theme.textTheme.titleLarge), Text('Qualità', style: theme.textTheme.titleLarge),