Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

53 lines
1.7KB

  1. import 'package:flutter/material.dart';
  2. import '../../../routes/app_routes.dart';
  3. class HomeScreen extends StatelessWidget {
  4. const HomeScreen({super.key});
  5. @override
  6. Widget build(BuildContext context) => Scaffold(
  7. appBar: AppBar(
  8. automaticallyImplyLeading: false,
  9. title: const Text('Accueil'),
  10. // Optionnel : Ajoutez un bouton de déconnexion
  11. actions: [
  12. IconButton(
  13. icon: const Icon(Icons.logout),
  14. tooltip: 'Déconnexion',
  15. onPressed: () {
  16. // Navigue vers l'écran de login et supprime toutes les routes précédentes
  17. Navigator.of(context).pushNamedAndRemoveUntil(
  18. AppRoutes.login,
  19. (route) => false
  20. );
  21. },
  22. )
  23. ],
  24. ),
  25. body: Center(
  26. child: Column(
  27. mainAxisAlignment: MainAxisAlignment.center,
  28. children: [
  29. const Text(
  30. 'Vous êtes connecté !',
  31. style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
  32. ),
  33. const SizedBox(height: 40),
  34. ElevatedButton.icon(
  35. icon: const Icon(Icons.add_photo_alternate_outlined),
  36. label: const Text('Commencer une nouvelle publication'),
  37. onPressed: () {
  38. // Lance le parcours de création de post existant
  39. Navigator.of(context).pushNamed(AppRoutes.mediaPicker);
  40. },
  41. style: ElevatedButton.styleFrom(
  42. padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
  43. ),
  44. )
  45. ],
  46. ),
  47. ),
  48. );
  49. }