refactoring and checkpoint
This commit is contained in:
@@ -1,19 +1,163 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../core/constants/colors.dart'; // Importez les couleurs dynamiques
|
||||
import '../../widgets/friend_suggestions.dart';
|
||||
import '../../widgets/group_list.dart';
|
||||
import '../../widgets/popular_activity_list.dart';
|
||||
import '../../widgets/quick_action_button.dart';
|
||||
import '../../widgets/recommended_event_list.dart';
|
||||
import '../../widgets/section_header.dart';
|
||||
import '../../widgets/story_section.dart';
|
||||
|
||||
class HomeContentScreen extends StatelessWidget {
|
||||
const HomeContentScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(
|
||||
child: Text(
|
||||
'Accueil',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
final size = MediaQuery.of(context).size;
|
||||
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 15.0), // Marges réduites
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Section de bienvenue
|
||||
_buildWelcomeCard(),
|
||||
|
||||
const SizedBox(height: 15), // Espacement vertical réduit
|
||||
|
||||
// Section "Moments populaires"
|
||||
_buildCard(
|
||||
context: context,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader(
|
||||
title: 'Moments populaires',
|
||||
icon: Icons.camera_alt,
|
||||
textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), // Taille ajustée
|
||||
),
|
||||
const SizedBox(height: 10), // Espace vertical réduit
|
||||
StorySection(size: size),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 15), // Espacement réduit
|
||||
|
||||
// Section des événements recommandés
|
||||
_buildCard(
|
||||
context: context,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader(
|
||||
title: 'Événements recommandés',
|
||||
icon: Icons.star,
|
||||
textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 10), // Espacement réduit
|
||||
RecommendedEventList(size: size),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 15), // Espacement réduit
|
||||
|
||||
// Section des activités populaires
|
||||
_buildCard(
|
||||
context: context,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader(
|
||||
title: 'Activités populaires',
|
||||
icon: Icons.local_activity,
|
||||
textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 10), // Espacement réduit
|
||||
PopularActivityList(size: size),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 15), // Espacement réduit
|
||||
|
||||
// Section des groupes sociaux
|
||||
_buildCard(
|
||||
context: context,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader(
|
||||
title: 'Groupes à rejoindre',
|
||||
icon: Icons.group_add,
|
||||
textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 10), // Espacement réduit
|
||||
GroupList(size: size),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 15), // Espacement réduit
|
||||
|
||||
// Section des suggestions d'amis
|
||||
_buildCard(
|
||||
context: context,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader(
|
||||
title: 'Suggestions d’amis',
|
||||
icon: Icons.person_add,
|
||||
textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 10), // Espacement réduit
|
||||
FriendSuggestions(size: size),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Widget pour la carte de bienvenue
|
||||
Widget _buildWelcomeCard() {
|
||||
return Card(
|
||||
elevation: 5,
|
||||
color: AppColors.surface, // Utilisation de la couleur dynamique pour la surface
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Bienvenue, Dahoud!',
|
||||
style: TextStyle(
|
||||
color: AppColors.textPrimary, // Texte dynamique
|
||||
fontSize: 22, // Taille de police réduite
|
||||
fontWeight: FontWeight.w600, // Poids de police ajusté
|
||||
),
|
||||
),
|
||||
Icon(Icons.waving_hand, color: Colors.orange.shade300, size: 24), // Taille de l'icône ajustée
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Widget générique pour créer une carte design avec des espaces optimisés
|
||||
Widget _buildCard({required BuildContext context, required Widget child}) {
|
||||
return Card(
|
||||
elevation: 3, // Réduction de l'élévation pour un look plus épuré
|
||||
color: AppColors.surface, // Utilisation de la couleur dynamique pour la surface
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), // Coins légèrement arrondis
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0), // Padding interne réduit pour un contenu plus compact
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user