You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.7KB

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