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:
@@ -16,6 +16,7 @@ import '../../providers/match_rules_provider.dart';
|
||||
import '../../providers/score_provider.dart';
|
||||
import '../../shared/api_client.dart';
|
||||
import '../../shared/regia_share.dart';
|
||||
import '../../shared/watch_share.dart';
|
||||
import '../../shared/models/score_state.dart';
|
||||
import '../../providers/session_provider.dart';
|
||||
import '../../shared/websocket_service.dart';
|
||||
@@ -232,6 +233,50 @@ class _CameraScreenState extends ConsumerState<CameraScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _shareWatch() async {
|
||||
final session = ref.read(sessionProvider).session;
|
||||
final match = ref.read(sessionProvider).match;
|
||||
if (session == null) return;
|
||||
await shareWatchLink(
|
||||
context,
|
||||
session: session,
|
||||
title:
|
||||
'Diretta — ${match?.teamName ?? 'Casa'} vs ${match?.opponentName ?? 'Ospiti'}',
|
||||
);
|
||||
}
|
||||
|
||||
void _showShareMenu() {
|
||||
final session = ref.read(sessionProvider).session;
|
||||
if (session == null) return;
|
||||
final isYoutube = session.platform == 'youtube';
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
builder: (ctx) => SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.live_tv),
|
||||
title: Text(isYoutube ? 'Condividi link YouTube' : 'Condividi link diretta'),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
_shareWatch();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.scoreboard),
|
||||
title: const Text('Condividi link regia (punteggio)'),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
_shareRegia();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _leaveSession() async {
|
||||
try {
|
||||
await StreamingChannel.stopStream();
|
||||
@@ -342,7 +387,7 @@ class _CameraScreenState extends ConsumerState<CameraScreen> {
|
||||
bitrateMbps: _bitrateMbps,
|
||||
fps: _fps,
|
||||
viewerCount: _viewerCount,
|
||||
onShareRegia: _shareRegia,
|
||||
onShare: _showShareMenu,
|
||||
onInterrupt: _interruptStream,
|
||||
onCloseStream: _closeStreamPermanently,
|
||||
pointsTarget: pointsTarget,
|
||||
@@ -358,7 +403,7 @@ class _CameraScreenState extends ConsumerState<CameraScreen> {
|
||||
bitrateMbps: _bitrateMbps,
|
||||
fps: _fps,
|
||||
viewerCount: _viewerCount,
|
||||
onShareRegia: _shareRegia,
|
||||
onShare: _showShareMenu,
|
||||
onInterrupt: _interruptStream,
|
||||
onCloseStream: _closeStreamPermanently,
|
||||
pointsTarget: pointsTarget,
|
||||
@@ -380,7 +425,7 @@ class _PortraitOverlay extends StatelessWidget {
|
||||
required this.bitrateMbps,
|
||||
required this.fps,
|
||||
required this.viewerCount,
|
||||
required this.onShareRegia,
|
||||
required this.onShare,
|
||||
required this.onInterrupt,
|
||||
required this.onCloseStream,
|
||||
required this.pointsTarget,
|
||||
@@ -395,7 +440,7 @@ class _PortraitOverlay extends StatelessWidget {
|
||||
final double bitrateMbps;
|
||||
final int fps;
|
||||
final int viewerCount;
|
||||
final VoidCallback onShareRegia;
|
||||
final VoidCallback onShare;
|
||||
final VoidCallback onInterrupt;
|
||||
final Future<void> Function() onCloseStream;
|
||||
final int pointsTarget;
|
||||
@@ -413,9 +458,9 @@ class _PortraitOverlay extends StatelessWidget {
|
||||
LiveBadge(elapsed: elapsed),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
onPressed: onShareRegia,
|
||||
onPressed: onShare,
|
||||
icon: const Icon(Icons.share),
|
||||
tooltip: 'Condividi link regia',
|
||||
tooltip: 'Condividi link',
|
||||
),
|
||||
CameraCompactMetrics(
|
||||
networkType: networkType,
|
||||
@@ -451,9 +496,9 @@ class _PortraitOverlay extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
OutlinedButton.icon(
|
||||
onPressed: onShareRegia,
|
||||
onPressed: onShare,
|
||||
icon: const Icon(Icons.share, size: 18),
|
||||
label: const Text('Condividi link regia'),
|
||||
label: const Text('Condividi link'),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
OutlinedButton(
|
||||
@@ -485,7 +530,7 @@ class _LandscapeOverlay extends StatelessWidget {
|
||||
required this.bitrateMbps,
|
||||
required this.fps,
|
||||
required this.viewerCount,
|
||||
required this.onShareRegia,
|
||||
required this.onShare,
|
||||
required this.onInterrupt,
|
||||
required this.onCloseStream,
|
||||
required this.pointsTarget,
|
||||
@@ -501,7 +546,7 @@ class _LandscapeOverlay extends StatelessWidget {
|
||||
final double bitrateMbps;
|
||||
final int fps;
|
||||
final int viewerCount;
|
||||
final VoidCallback onShareRegia;
|
||||
final VoidCallback onShare;
|
||||
final VoidCallback onInterrupt;
|
||||
final Future<void> Function() onCloseStream;
|
||||
final int pointsTarget;
|
||||
@@ -557,9 +602,9 @@ class _LandscapeOverlay extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: onShareRegia,
|
||||
onPressed: onShare,
|
||||
icon: const Icon(Icons.share, color: Colors.white),
|
||||
tooltip: 'Condividi link regia',
|
||||
tooltip: 'Condividi link',
|
||||
),
|
||||
Expanded(
|
||||
child: OutlinedButton(
|
||||
|
||||
Reference in New Issue
Block a user