feat : Replace tab system
This commit is contained in:
@@ -25,7 +25,9 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
|||||||
length: 2,
|
length: 2,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
body: SingleChildScrollView(
|
body: NestedScrollView(
|
||||||
|
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||||
|
SliverToBoxAdapter(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@@ -39,7 +41,7 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 16.0, bottom: 0.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -47,18 +49,17 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
|||||||
Text(
|
Text(
|
||||||
'Disc\'Octonelle 2',
|
'Disc\'Octonelle 2',
|
||||||
style: Theme.of(context).textTheme.headlineLarge?.copyWith(
|
style: Theme.of(context).textTheme.headlineLarge?.copyWith(
|
||||||
color: Colors.black
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.of(context).size.width * 0.8,
|
width: MediaQuery.of(context).size.width * 0.8,
|
||||||
child: Table(
|
child: Table(
|
||||||
columnWidths: const {
|
columnWidths: const {
|
||||||
0: FixedColumnWidth(80.0), // Largeur fixe pour les icônes
|
0: FixedColumnWidth(80.0),
|
||||||
1: FlexColumnWidth(), // Prend l'espace restant
|
1: FlexColumnWidth(),
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
// Date
|
// Date
|
||||||
@@ -179,9 +180,7 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// TabBar
|
// TabBar
|
||||||
TabBar(
|
TabBar(
|
||||||
tabs: const [
|
tabs: const [
|
||||||
@@ -199,47 +198,50 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
|||||||
viewModel.setSelectedTab(index);
|
viewModel.setSelectedTab(index);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
// Contenu des onglets basé sur l'index sélectionné
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
body: TabBarView(
|
||||||
|
children: [
|
||||||
|
// Tab 1: Publications
|
||||||
Container(
|
Container(
|
||||||
color: const Color(0xFFEFF0FF),
|
color: const Color(0xFFEFF0FF),
|
||||||
|
child: ListView.builder(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: viewModel.selectedTabIndex == 0
|
itemCount: 10,
|
||||||
? Column(
|
itemBuilder: (context, index) {
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: List.generate(10, (index) {
|
|
||||||
return PostCardWidget(
|
return PostCardWidget(
|
||||||
title: 'Publication ${index + 1}',
|
title: 'Publication ${index + 1}',
|
||||||
content: 'Voici le contenu de la publication ${index + 1}. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
content: 'Voici le contenu de la publication ${index + 1}. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
||||||
authorName: 'L\'Octonelle',
|
authorName: 'L\'Octonelle',
|
||||||
authorImageUrl: '', // URL vide pour utiliser l'icône par défaut
|
authorImageUrl: '',
|
||||||
publishDate: DateTime.now().subtract(Duration(days: index)),
|
publishDate: DateTime.now().subtract(Duration(days: index)),
|
||||||
imageUrls: index % 3 == 0 ? ['assets/images/Affiche.jpg'] : null,
|
imageUrls: index % 3 == 0 ? ['assets/images/Affiche.jpg'] : null,
|
||||||
likesCount: (index + 1) * 5,
|
likesCount: (index + 1) * 5,
|
||||||
commentsCount: (index + 1) * 2,
|
commentsCount: (index + 1) * 2,
|
||||||
aspectRatio: 4/5,
|
aspectRatio: 4/5,
|
||||||
onLike: () {
|
onLike: () {
|
||||||
// Action lors du clic sur "J'aime"
|
|
||||||
print('Like publication ${index + 1}');
|
print('Like publication ${index + 1}');
|
||||||
},
|
},
|
||||||
onComment: () {
|
onComment: () {
|
||||||
// Action lors du clic sur "Commenter"
|
|
||||||
print('Comment publication ${index + 1}');
|
print('Comment publication ${index + 1}');
|
||||||
},
|
},
|
||||||
onShare: () {
|
onShare: () {
|
||||||
// Action lors du clic sur "Partager"
|
|
||||||
print('Share publication ${index + 1}');
|
print('Share publication ${index + 1}');
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}),
|
},
|
||||||
)
|
),
|
||||||
: Column(
|
),
|
||||||
mainAxisSize: MainAxisSize.min,
|
// Tab 2: À propos
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
Container(
|
||||||
|
color: const Color(0xFFEFF0FF),
|
||||||
|
child: ListView(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'À propos de L\'Octonelle',
|
'À propos de L\'Octonelle',
|
||||||
@@ -253,7 +255,6 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
|||||||
'Description détaillée de l\'organisation L\'Octonelle et de ses activités...',
|
'Description détaillée de l\'organisation L\'Octonelle et de ses activités...',
|
||||||
style: TextStyle(color: Colors.black87),
|
style: TextStyle(color: Colors.black87),
|
||||||
),
|
),
|
||||||
// Contenu supplémentaire pour tester le scroll
|
|
||||||
...List.generate(20, (index) => Padding(
|
...List.generate(20, (index) => Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Text('Ligne de contenu ${index + 1}'),
|
child: Text('Ligne de contenu ${index + 1}'),
|
||||||
|
|||||||
Reference in New Issue
Block a user