- 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>
47 lines
1.4 KiB
Dart
47 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../l10n/app_localizations.dart';
|
|
|
|
/// Boutons d'action de l'écran game over : rejouer ou retourner au Pokédex.
|
|
class GameOverActions extends StatelessWidget {
|
|
final VoidCallback onTryAgain;
|
|
final VoidCallback onBack;
|
|
|
|
const GameOverActions({super.key, required this.onTryAgain, required this.onBack});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l = AppLocalizations.of(context)!;
|
|
return Column(
|
|
children: [
|
|
_button(label: l.tryAgain, icon: Icons.refresh, color: const Color(0xFF2962FF), onPressed: onTryAgain),
|
|
const SizedBox(height: 16),
|
|
_button(label: l.backToPokedex, icon: Icons.menu_book, color: const Color(0xFFA66A00), onPressed: onBack),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _button({
|
|
required String label,
|
|
required IconData icon,
|
|
required Color color,
|
|
required VoidCallback onPressed,
|
|
}) {
|
|
return SizedBox(
|
|
width: double.infinity,
|
|
height: 60,
|
|
child: ElevatedButton.icon(
|
|
onPressed: onPressed,
|
|
icon: Icon(icon, color: Colors.white, size: 24),
|
|
label: Text(
|
|
label,
|
|
style: const TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold, letterSpacing: 2),
|
|
),
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: color,
|
|
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|