App: scelta canale YouTube MLTV/società, privacy e condivisione link.
Premium Full può forzare il canale piattaforma; visibilità non in elenco o privato; share_url unificato per Match Live TV e YouTube. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,7 +3,6 @@ import 'dart:math';
|
||||
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
@@ -16,6 +15,7 @@ import '../../shared/models/score_state.dart';
|
||||
import '../../shared/models/stream_session.dart';
|
||||
import '../../shared/websocket_service.dart';
|
||||
import '../../shared/regia_share.dart';
|
||||
import '../../shared/watch_share.dart';
|
||||
import '../../shared/widgets/metric_card.dart';
|
||||
import '../../shared/widgets/primary_cta.dart';
|
||||
import '../../shared/widgets/screen_insets.dart';
|
||||
@@ -201,7 +201,7 @@ class _StepNetworkTestState extends ConsumerState<StepNetworkTest> {
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
if (ref.read(sessionProvider).session?.watchPageUrl != null) ...[
|
||||
if (watchShareUrl(ref.read(sessionProvider).session!) != null) ...[
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
@@ -213,25 +213,43 @@ class _StepNetworkTestState extends ConsumerState<StepNetworkTest> {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Link per gli spettatori',
|
||||
ref.read(sessionProvider).session!.platform == 'youtube'
|
||||
? 'Link video YouTube'
|
||||
: 'Link diretta Match Live TV',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
SelectableText(
|
||||
ref.read(sessionProvider).session!.watchPageUrl!,
|
||||
watchShareUrl(ref.read(sessionProvider).session!)!,
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
OutlinedButton.icon(
|
||||
onPressed: () {
|
||||
final url = ref.read(sessionProvider).session!.watchPageUrl!;
|
||||
Clipboard.setData(ClipboardData(text: url));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Link copiato')),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.link, size: 18),
|
||||
label: const Text('COPIA LINK DIRETTA'),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: OutlinedButton.icon(
|
||||
onPressed: () => copyWatchLink(
|
||||
context,
|
||||
ref.read(sessionProvider).session!,
|
||||
),
|
||||
icon: const Icon(Icons.link, size: 18),
|
||||
label: const Text('COPIA'),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: OutlinedButton.icon(
|
||||
onPressed: () => shareWatchLink(
|
||||
context,
|
||||
session: ref.read(sessionProvider).session!,
|
||||
title:
|
||||
'Diretta — ${widget.match.teamName} vs ${widget.match.opponentName}',
|
||||
),
|
||||
icon: const Icon(Icons.share, size: 18),
|
||||
label: const Text('CONDIVIDI'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -251,19 +269,33 @@ class _StepNetworkTestState extends ConsumerState<StepNetworkTest> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
OutlinedButton.icon(
|
||||
onPressed: ref.read(sessionProvider).session == null
|
||||
? null
|
||||
: () => shareRegiaLink(
|
||||
context,
|
||||
ref,
|
||||
sessionId: ref.read(sessionProvider).session!.id,
|
||||
shareSubject:
|
||||
'Regia — ${widget.match.teamName} vs ${widget.match.opponentName}',
|
||||
),
|
||||
icon: const Icon(Icons.share),
|
||||
label: const Text('Condividi link regia (punteggio)'),
|
||||
),
|
||||
if (ref.read(sessionProvider).session != null) ...[
|
||||
OutlinedButton.icon(
|
||||
onPressed: () => shareWatchLink(
|
||||
context,
|
||||
session: ref.read(sessionProvider).session!,
|
||||
title: 'Diretta — ${widget.match.teamName} vs ${widget.match.opponentName}',
|
||||
),
|
||||
icon: const Icon(Icons.live_tv),
|
||||
label: Text(
|
||||
ref.read(sessionProvider).session!.platform == 'youtube'
|
||||
? 'Condividi link YouTube'
|
||||
: 'Condividi link diretta',
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
OutlinedButton.icon(
|
||||
onPressed: () => shareRegiaLink(
|
||||
context,
|
||||
ref,
|
||||
sessionId: ref.read(sessionProvider).session!.id,
|
||||
shareSubject:
|
||||
'Regia — ${widget.match.teamName} vs ${widget.match.opponentName}',
|
||||
),
|
||||
icon: const Icon(Icons.scoreboard),
|
||||
label: const Text('Condividi link regia (punteggio)'),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 24),
|
||||
OutlinedButton(
|
||||
onPressed: _testing ? null : _runTest,
|
||||
|
||||
Reference in New Issue
Block a user