68 lines
2.1 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;
final Color primaryDark;
final Color surfaceColor;
const GameOverHeader({
super.key,
required this.pokemonImage,
required this.pokemonName,
required this.primaryDark,
required this.surfaceColor,
});
static const _silverBg = Color(0xFFC8D1D8);
@override
Widget build(BuildContext context) {
final l = AppLocalizations.of(context)!;
return Container(
decoration: BoxDecoration(color: primaryDark, border: Border.all(color: primaryDark, width: 4)),
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 16),
color: _silverBg,
child: Column(
children: [
Container(
color: primaryDark,
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: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: surfaceColor,
letterSpacing: 1,
),
),
const SizedBox(height: 8),
],
),
),
);
}
}