Compare commits
2 Commits
1dd8b741e9
...
6429854028
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6429854028 | ||
|
|
8067125921 |
56
lib/ui/common/animator_widget.dart
Normal file
56
lib/ui/common/animator_widget.dart
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AnimatorWidget extends StatefulWidget {
|
||||||
|
final String authorName;
|
||||||
|
final String authorImageUrl;
|
||||||
|
final DateTime? publishDate;
|
||||||
|
final List<String>? imageUrls;
|
||||||
|
final int likesCount;
|
||||||
|
final int commentsCount;
|
||||||
|
final int sharesCount;
|
||||||
|
final VoidCallback? onLike;
|
||||||
|
final VoidCallback? onComment;
|
||||||
|
final VoidCallback? onShare;
|
||||||
|
final double? aspectRatio; // Nouveau paramètre pour le ratio (largeur/hauteur)
|
||||||
|
|
||||||
|
const AnimatorWidget({
|
||||||
|
Key? key,
|
||||||
|
required this.authorName,
|
||||||
|
required this.authorImageUrl,
|
||||||
|
this.publishDate,
|
||||||
|
this.imageUrls,
|
||||||
|
this.likesCount = 0,
|
||||||
|
this.commentsCount = 0,
|
||||||
|
this.sharesCount = 0,
|
||||||
|
this.onLike,
|
||||||
|
this.onComment,
|
||||||
|
this.onShare,
|
||||||
|
this.aspectRatio, // null = ratio naturel de l'image, ex: 16/9, 4/3, 1/1
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AnimatorWidget> createState() => _AnimatorWidgetWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AnimatorWidgetWidgetState extends State<AnimatorWidget> {
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
CircleAvatar(
|
||||||
|
backgroundImage: NetworkImage(widget.authorImageUrl),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(widget.authorName, style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: Colors.black)),
|
||||||
|
//Text('${widget.publishDate.toLocal()}'.split(' ')[0], style: const TextStyle(color: Colors.grey, fontSize: 12)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,7 +2,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
import 'event_details_viewmodel.dart';
|
import 'event_details_viewmodel.dart';
|
||||||
import '../../common/post_card_widget.dart';
|
import 'package:bahla_front/ui/common/ReadMoreText.dart';
|
||||||
|
import 'package:bahla_front/ui/common/animator_widget.dart';
|
||||||
|
import 'package:bahla_front/ui/common/post_card_widget.dart';
|
||||||
|
|
||||||
class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
||||||
final int eventId;
|
final int eventId;
|
||||||
@@ -240,25 +242,38 @@ class EventDetailsView extends StackedView<EventDetailsViewModel> {
|
|||||||
// Tab 2: À propos
|
// Tab 2: À propos
|
||||||
Container(
|
Container(
|
||||||
color: const Color(0xFFEFF0FF),
|
color: const Color(0xFFEFF0FF),
|
||||||
child: ListView(
|
child: Column(
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Container(
|
||||||
'À propos de L\'Octonelle',
|
padding: const EdgeInsets.all(16.0),
|
||||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
child: ReadMoreText(
|
||||||
color: Colors.black,
|
'Bienvenue à Disc\'Octonelle 2 ! \n\nRejoignez-nous pour une soirée inoubliable de musique, de danse et de bonne humeur. \n\nQue vous soyez amateur de rock, de pop, de jazz ou d\'électro, il y en aura pour tous les goûts. \nVenez découvrir des artistes locaux et internationaux dans une ambiance conviviale et festive. \nNe manquez pas cette occasion unique de faire la fête et de créer des souvenirs mémorables avec vos amis. Nous avons hâte de vous accueillir à Disc\'Octonelle 2 !',
|
||||||
fontWeight: FontWeight.bold,
|
trimLines: 10,
|
||||||
|
collapsedText: '... Voir plus',
|
||||||
|
expandedText: ' Voir moins',
|
||||||
|
textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
|
color: Colors.black,
|
||||||
|
height: 1.4,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
Divider(height: 2, indent: 20, endIndent: 20, color: Theme.of(context).colorScheme.primary),
|
||||||
const Text(
|
// The ListView inside a Column needs bounded height => wrap with Expanded
|
||||||
'Description détaillée de l\'organisation L\'Octonelle et de ses activités...',
|
Expanded(
|
||||||
style: TextStyle(color: Colors.black87),
|
child: ListView.builder(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
itemCount: 10,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 12.0),
|
||||||
|
child: AnimatorWidget(
|
||||||
|
authorName: 'Animateur ${index + 1}',
|
||||||
|
authorImageUrl: 'https://placehold.co/400x400/png',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
...List.generate(20, (index) => Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
|
||||||
child: Text('Ligne de contenu ${index + 1}'),
|
|
||||||
)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -33,3 +33,16 @@ class Post {
|
|||||||
required this.content,
|
required this.content,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Animator {
|
||||||
|
final String id;
|
||||||
|
final String name;
|
||||||
|
final String content;
|
||||||
|
final String authorImageUrl = 'https://placehold.co/400x400/png';
|
||||||
|
|
||||||
|
Animator({
|
||||||
|
required this.id,
|
||||||
|
required this.name,
|
||||||
|
required this.content,
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user