- gen-l10n setup (flutter_localizations, intl, l10n.yaml, ARB en/fr) - localeProvider (persisted) wired into MaterialApp - language selector in the System page (alongside the color palette) - all user-facing strings across screens moved to AppLocalizations Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
61 lines
2.0 KiB
Dart
61 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../l10n/app_localizations.dart';
|
|
import '../pokemon_image.dart';
|
|
|
|
/// Bloc supérieur de l'écran game over : bannière "GAME OVER", image et nom du Pokémon.
|
|
class GameOverHeader extends StatelessWidget {
|
|
final String pokemonImage;
|
|
final String pokemonName;
|
|
|
|
const GameOverHeader({super.key, required this.pokemonImage, required this.pokemonName});
|
|
|
|
static const _darkRed = Color(0xFF9E1B1B);
|
|
static const _silverBg = Color(0xFFC8D1D8);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l = AppLocalizations.of(context)!;
|
|
return Container(
|
|
decoration: BoxDecoration(color: _darkRed, border: Border.all(color: _darkRed, width: 4)),
|
|
child: Container(
|
|
width: double.infinity,
|
|
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 16),
|
|
color: _silverBg,
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
color: _darkRed,
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
|
child: Text(
|
|
l.gameOver,
|
|
style: const TextStyle(
|
|
fontSize: 26,
|
|
color: Colors.yellow,
|
|
fontWeight: FontWeight.bold,
|
|
letterSpacing: 2,
|
|
shadows: [Shadow(offset: Offset(1.5, 1.5), color: Colors.black)],
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
if (pokemonImage.isNotEmpty)
|
|
SizedBox(height: 140, child: PokemonImage(imageUrl: pokemonImage, fit: BoxFit.contain)),
|
|
const SizedBox(height: 12),
|
|
Text(
|
|
l.itWas(pokemonName),
|
|
textAlign: TextAlign.center,
|
|
style: const TextStyle(
|
|
fontSize: 22,
|
|
fontWeight: FontWeight.bold,
|
|
color: Color(0xFF1B2333),
|
|
letterSpacing: 1,
|
|
),
|
|
),
|
|
const SizedBox(height: 8),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|