refactor: remove invite dialog

This commit is contained in:
edde746
2025-12-19 04:08:11 +01:00
parent b1d2b4f3f1
commit 789f1f468d
10 changed files with 6691 additions and 12853 deletions
+6685 -12618
View File
File diff suppressed because it is too large Load Diff
+1 -11
View File
@@ -285,9 +285,7 @@
"noItemsAvailable": "No items available",
"failedToCreatePlayQueue": "Failed to create play queue",
"failedToCreatePlayQueueNoItems": "Failed to create play queue - no items",
"failedPlayback": "Failed to ${action}: ${error}",
"youAreOffline": "You're Offline",
"offlineFeatureUnavailable": "This feature requires an internet connection. Your downloads and settings are still available."
"failedPlayback": "Failed to ${action}: ${error}"
},
"subtitlingStyling": {
"stylingOptions": "Styling Options",
@@ -514,16 +512,8 @@
"leaveSessionConfirmOverlay": "You will be disconnected from the watch session.",
"end": "End",
"leave": "Leave",
"inviteOthers": "Invite others",
"syncing": "Syncing...",
"participant": "participant",
"participantsPlural": "participants",
"copyCode": "Copy code",
"shareInstructions": "Share this code with others to let them join your watch session.",
"codeCopied": "Session code copied to clipboard",
"share": "Share",
"inviteText": "Join my Watch Together session!\n\nSession Code: ${sessionId}",
"inviteSubject": "Watch Together Invite",
"joinWatchSession": "Join Watch Session",
"enterCodeHint": "Enter 8-character code",
"pasteFromClipboard": "Paste from clipboard",
+1 -11
View File
@@ -286,9 +286,7 @@
"noItemsAvailable": "Keine Elemente verfügbar",
"failedToCreatePlayQueue": "Wiedergabewarteschlange konnte nicht erstellt werden",
"failedToCreatePlayQueueNoItems": "Wiedergabewarteschlange konnte nicht erstellt werden keine Elemente",
"failedPlayback": "Wiedergabe für ${action} fehlgeschlagen: ${error}",
"youAreOffline": "Du bist offline",
"offlineFeatureUnavailable": "Diese Funktion erfordert eine Internetverbindung. Deine Downloads und Einstellungen sind weiterhin verfügbar."
"failedPlayback": "Wiedergabe für ${action} fehlgeschlagen: ${error}"
},
"subtitlingStyling": {
"stylingOptions": "Stiloptionen",
@@ -532,16 +530,8 @@
"leaveSessionConfirmOverlay": "Du wirst von der Schausitzung getrennt.",
"end": "Beenden",
"leave": "Verlassen",
"inviteOthers": "Andere einladen",
"syncing": "Synchronisieren...",
"participant": "Teilnehmer",
"participantsPlural": "Teilnehmer",
"copyCode": "Code kopieren",
"shareInstructions": "Teile diesen Code mit anderen, damit sie deiner Schausitzung beitreten können.",
"codeCopied": "Sitzungscode in Zwischenablage kopiert",
"share": "Teilen",
"inviteText": "Tritt meiner Gemeinsam Schauen-Sitzung bei!\n\nSitzungscode: ${sessionId}",
"inviteSubject": "Gemeinsam Schauen Einladung",
"joinWatchSession": "Schausitzung Beitreten",
"enterCodeHint": "8-stelligen Code eingeben",
"pasteFromClipboard": "Aus Zwischenablage einfügen",
+1 -11
View File
@@ -286,9 +286,7 @@
"noItemsAvailable": "Nessun elemento disponibile",
"failedToCreatePlayQueue": "Impossibile creare la coda di riproduzione",
"failedToCreatePlayQueueNoItems": "Impossibile creare la coda di riproduzione - nessun elemento",
"failedPlayback": "Impossibile ${action}: ${error}",
"youAreOffline": "Sei offline",
"offlineFeatureUnavailable": "Questa funzione richiede una connessione internet. I tuoi download e le impostazioni sono ancora disponibili."
"failedPlayback": "Impossibile ${action}: ${error}"
},
"subtitlingStyling": {
"stylingOptions": "Opzioni stile",
@@ -532,16 +530,8 @@
"leaveSessionConfirmOverlay": "Sarai disconnesso dalla sessione di visione.",
"end": "Termina",
"leave": "Lascia",
"inviteOthers": "Invita altri",
"syncing": "Sincronizzazione...",
"participant": "partecipante",
"participantsPlural": "partecipanti",
"copyCode": "Copia codice",
"shareInstructions": "Condividi questo codice con altri per farli unire alla tua sessione di visione.",
"codeCopied": "Codice sessione copiato negli appunti",
"share": "Condividi",
"inviteText": "Unisciti alla mia sessione Guarda Insieme!\n\nCodice Sessione: ${sessionId}",
"inviteSubject": "Invito Guarda Insieme",
"joinWatchSession": "Unisciti alla Sessione di Visione",
"enterCodeHint": "Inserisci codice di 8 caratteri",
"pasteFromClipboard": "Incolla dagli appunti",
+1 -11
View File
@@ -286,9 +286,7 @@
"noItemsAvailable": "Geen items beschikbaar",
"failedToCreatePlayQueue": "Kan afspeelwachtrij niet maken",
"failedToCreatePlayQueueNoItems": "Kan afspeelwachtrij niet maken - geen items",
"failedPlayback": "Afspelen van ${action} mislukt: ${error}",
"youAreOffline": "Je bent offline",
"offlineFeatureUnavailable": "Deze functie vereist een internetverbinding. Je downloads en instellingen zijn nog steeds beschikbaar."
"failedPlayback": "Afspelen van ${action} mislukt: ${error}"
},
"subtitlingStyling": {
"stylingOptions": "Opmaak opties",
@@ -532,16 +530,8 @@
"leaveSessionConfirmOverlay": "Je wordt losgekoppeld van de kijksessie.",
"end": "Beëindigen",
"leave": "Verlaten",
"inviteOthers": "Anderen uitnodigen",
"syncing": "Synchroniseren...",
"participant": "deelnemer",
"participantsPlural": "deelnemers",
"copyCode": "Code kopiëren",
"shareInstructions": "Deel deze code met anderen om hen te laten deelnemen aan je kijksessie.",
"codeCopied": "Sessiecode gekopieerd naar klembord",
"share": "Delen",
"inviteText": "Doe mee met mijn Samen Kijken sessie!\n\nSessiecode: ${sessionId}",
"inviteSubject": "Samen Kijken Uitnodiging",
"joinWatchSession": "Kijksessie Deelnemen",
"enterCodeHint": "Voer 8-teken code in",
"pasteFromClipboard": "Plakken van klembord",
+1 -11
View File
@@ -286,9 +286,7 @@
"noItemsAvailable": "Inga objekt tillgängliga",
"failedToCreatePlayQueue": "Det gick inte att skapa uppspelningskö",
"failedToCreatePlayQueueNoItems": "Det gick inte att skapa uppspelningskö inga objekt",
"failedPlayback": "Kunde inte ${action}: ${error}",
"youAreOffline": "Du är offline",
"offlineFeatureUnavailable": "Denna funktion kräver en internetanslutning. Dina nedladdningar och inställningar är fortfarande tillgängliga."
"failedPlayback": "Kunde inte ${action}: ${error}"
},
"subtitlingStyling": {
"stylingOptions": "Stilalternativ",
@@ -532,16 +530,8 @@
"leaveSessionConfirmOverlay": "Du kommer att kopplas bort från tittarsessionen.",
"end": "Avsluta",
"leave": "Lämna",
"inviteOthers": "Bjud in andra",
"syncing": "Synkroniserar...",
"participant": "deltagare",
"participantsPlural": "deltagare",
"copyCode": "Kopiera kod",
"shareInstructions": "Dela denna kod med andra för att låta dem gå med i din tittarsession.",
"codeCopied": "Sessionskod kopierad till urklipp",
"share": "Dela",
"inviteText": "Gå med i min Titta Tillsammans-session!\n\nSessionskod: ${sessionId}",
"inviteSubject": "Titta Tillsammans-inbjudan",
"joinWatchSession": "Gå med i Tittarsession",
"enterCodeHint": "Ange 8-teckens kod",
"pasteFromClipboard": "Klistra in från urklipp",
+1 -11
View File
@@ -286,9 +286,7 @@
"noItemsAvailable": "没有可用的项目",
"failedToCreatePlayQueue": "创建播放队列失败",
"failedToCreatePlayQueueNoItems": "创建播放队列失败 - 没有项目",
"failedPlayback": "无法${action}: ${error}",
"youAreOffline": "您已离线",
"offlineFeatureUnavailable": "此功能需要网络连接。您的下载内容和设置仍然可用。"
"failedPlayback": "无法${action}: ${error}"
},
"subtitlingStyling": {
"stylingOptions": "样式选项",
@@ -532,16 +530,8 @@
"leaveSessionConfirmOverlay": "你将断开与观看会话的连接。",
"end": "结束",
"leave": "离开",
"inviteOthers": "邀请他人",
"syncing": "同步中...",
"participant": "参与者",
"participantsPlural": "参与者",
"copyCode": "复制代码",
"shareInstructions": "与他人分享此代码以让他们加入你的观看会话。",
"codeCopied": "会话代码已复制到剪贴板",
"share": "分享",
"inviteText": "加入我的一起看会话!\n\n会话代码:${sessionId}",
"inviteSubject": "一起看邀请",
"joinWatchSession": "加入观看会话",
"enterCodeHint": "输入8位代码",
"pasteFromClipboard": "从剪贴板粘贴",
-1
View File
@@ -13,6 +13,5 @@ export 'providers/watch_together_provider.dart';
export 'screens/watch_together_screen.dart';
// Widgets
export 'widgets/session_invite_dialog.dart';
export 'widgets/join_session_dialog.dart';
export 'widgets/watch_together_overlay.dart';
@@ -1,152 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:share_plus/share_plus.dart';
import '../../i18n/strings.g.dart';
/// Dialog for sharing a watch together session with others
class SessionInviteDialog extends StatelessWidget {
final String sessionId;
final int participantCount;
const SessionInviteDialog({super.key, required this.sessionId, required this.participantCount});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Dialog(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 400),
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Header
Row(
children: [
Icon(Symbols.group, color: theme.colorScheme.primary),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(t.watchTogether.title, style: theme.textTheme.titleLarge),
Text(
'$participantCount ${participantCount == 1 ? t.watchTogether.participant : t.watchTogether.participantsPlural}',
style: theme.textTheme.bodySmall?.copyWith(color: theme.colorScheme.onSurfaceVariant),
),
],
),
),
IconButton(onPressed: () => Navigator.of(context).pop(), icon: const Icon(Symbols.close)),
],
),
const SizedBox(height: 24),
// QR Code
Center(
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)),
child: QrImageView(
data: sessionId,
version: QrVersions.auto,
size: 180,
backgroundColor: Colors.white,
eyeStyle: const QrEyeStyle(eyeShape: QrEyeShape.square, color: Colors.black),
dataModuleStyle: const QrDataModuleStyle(
dataModuleShape: QrDataModuleShape.square,
color: Colors.black,
),
),
),
),
const SizedBox(height: 24),
// Session ID with copy button
Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: theme.colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(12),
),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
t.watchTogether.sessionCode,
style: theme.textTheme.bodySmall?.copyWith(color: theme.colorScheme.onSurfaceVariant),
),
const SizedBox(height: 4),
SelectableText(
sessionId,
style: theme.textTheme.headlineSmall?.copyWith(
fontFamily: 'monospace',
fontWeight: FontWeight.bold,
letterSpacing: 2,
),
),
],
),
),
IconButton(
onPressed: () => _copyToClipboard(context),
icon: const Icon(Symbols.content_copy),
tooltip: t.watchTogether.copyCode,
),
],
),
),
const SizedBox(height: 16),
// Instructions
Text(
t.watchTogether.shareInstructions,
style: theme.textTheme.bodyMedium?.copyWith(color: theme.colorScheme.onSurfaceVariant),
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
// Share button
FilledButton.icon(
onPressed: () => _share(context),
icon: const Icon(Symbols.share),
label: Text(t.watchTogether.share),
),
],
),
),
),
);
}
void _copyToClipboard(BuildContext context) {
Clipboard.setData(ClipboardData(text: sessionId));
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(t.watchTogether.codeCopied)));
}
void _share(BuildContext context) {
final text = t.watchTogether.inviteText(sessionId: sessionId);
Share.share(text, subject: t.watchTogether.inviteSubject);
}
}
/// Show the session invite dialog
Future<void> showSessionInviteDialog(BuildContext context, {required String sessionId, required int participantCount}) {
return showDialog(
context: context,
builder: (context) => SessionInviteDialog(sessionId: sessionId, participantCount: participantCount),
);
}
@@ -5,7 +5,6 @@ import 'package:provider/provider.dart';
import '../../i18n/strings.g.dart';
import '../models/watch_session.dart';
import '../providers/watch_together_provider.dart';
import 'session_invite_dialog.dart';
/// Overlay shown on the video player when in a watch together session
class WatchTogetherOverlay extends StatelessWidget {
@@ -201,21 +200,6 @@ class _SessionMenuSheet extends StatelessWidget {
const SizedBox(height: 8),
// Actions
if (provider.isHost && provider.sessionId != null)
ListTile(
leading: const Icon(Symbols.share),
title: Text(t.watchTogether.inviteOthers),
onTap: () {
Navigator.pop(context);
showSessionInviteDialog(
context,
sessionId: provider.sessionId!,
participantCount: provider.participantCount,
);
},
contentPadding: EdgeInsets.zero,
),
ListTile(
leading: Icon(Symbols.logout, color: theme.colorScheme.error),
title: Text(