Shuffle/app/lib/features/home/presentation/home_screen.dart
cschlaefke 7eaed46dc2
All checks were successful
CI / flutter (pull_request) Successful in 1m38s
CI / web-build (pull_request) Successful in 1m38s
CI / supabase (pull_request) Successful in 13s
CI / supabase-tests (pull_request) Successful in 35s
CI / e2e (pull_request) Successful in 2m58s
test(auth): address review findings on sign-in prompt (PR A)
Correct the focus comment (refs #61), test Space key and focus state,
prove scrollability at 200 percent text, drop needless minWidth, English
doc comment, allow OutlinedButton as secondary action in standalone cards,
English prompt text says plays instead of games.

Refs #49

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:25:22 +01:00

52 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shuffle/core/l10n/l10n.dart';
import 'package:shuffle/core/theme/app_spacing.dart';
import 'package:shuffle/features/auth/presentation/providers/sign_in_prompt_provider.dart';
import 'package:shuffle/features/auth/presentation/widgets/sign_in_prompt.dart';
/// Placeholder home screen. To be replaced by the catalog search / QUE-09.
///
/// Reads only [showSignInPromptProvider]; the decision whether the sign-in
/// prompt appears lives there (Spec #49 § 5.1).
class HomeScreen extends ConsumerWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final l10n = context.l10n;
final showPrompt = ref.watch(showSignInPromptProvider);
return Scaffold(
key: const Key('home_screen'),
appBar: AppBar(title: Text(l10n.appTitle)),
body: SafeArea(
child: LayoutBuilder(
builder: (context, constraints) => SingleChildScrollView(
padding: AppSpacing.pagePadding(constraints.maxWidth),
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.maxHeight - AppSpacing.lg * 2,
),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
l10n.homePlaceholderMessage,
key: const Key('home_placeholder_message'),
textAlign: TextAlign.center,
),
if (showPrompt) ...[
const SizedBox(height: AppSpacing.xl),
const SignInPrompt(),
],
],
),
),
),
),
),
),
);
}
}