Files
plezy/lib/widgets/oauth_proxy_dialog.dart
T
edde746 f1d4be70e2 feat(trackers): show a QR code in every tracker sign-in dialog and fit them on TV screens
Every tracker auth dialog (Trakt/Simkl/MDBList device-code and MAL/AniList
OAuth proxy) now shares the same PendingAuthDialog affordances: a QR code for
the sign-in URL, a large copyable URL with the scheme stripped, the browser
launch button (hidden on Apple TV, which has no browser), and the polling
spinner. On wide viewports (TV logical 960x540, desktop, phone landscape) the
QR pane sits beside the instructions so the dialog no longer clips on tvOS,
and the content is scrollable as an overflow safety net. Device activation
codes scale down instead of wrapping.
2026-08-10 08:33:11 +02:00

32 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import '../i18n/strings.g.dart';
import '../services/trackers/oauth_proxy_client.dart';
import 'pending_auth_dialog.dart';
/// Sign-in dialog for OAuth-proxy flows (MAL, AniList).
///
/// The [PendingAuthDialog] shell contributes everything this flow needs — QR
/// code, readable copyable URL, browser launch button, and the waiting
/// spinner — so it works uniformly on phones (user taps the button), desktops
/// (same), and TVs without a browser (user scans the QR with a phone).
class OAuthProxyDialog extends StatelessWidget {
final OAuthProxyStart start;
final String serviceName;
final VoidCallback onCancel;
const OAuthProxyDialog({super.key, required this.start, required this.serviceName, required this.onCancel});
@override
Widget build(BuildContext context) {
return PendingAuthDialog(
title: t.services.oauthProxy.title(service: serviceName),
body: t.services.oauthProxy.body,
url: start.url,
openLabel: t.services.oauthProxy.openToSignIn(service: serviceName),
onCancel: onCancel,
children: const [],
);
}
}