Refactoring + Checkpoint
This commit is contained in:
@@ -3,8 +3,9 @@ import 'package:afterwork/core/utils/date_formatter.dart';
|
||||
import 'event_menu.dart';
|
||||
|
||||
class EventHeader extends StatelessWidget {
|
||||
final String userFirstName;
|
||||
final String userLastName;
|
||||
final String creatorFirstName;
|
||||
final String creatorLastName;
|
||||
final String profileImageUrl;
|
||||
final String? eventDate;
|
||||
final String? imageUrl;
|
||||
final String location;
|
||||
@@ -14,8 +15,9 @@ class EventHeader extends StatelessWidget {
|
||||
|
||||
const EventHeader({
|
||||
Key? key,
|
||||
required this.userFirstName,
|
||||
required this.userLastName,
|
||||
required this.creatorFirstName,
|
||||
required this.creatorLastName,
|
||||
required this.profileImageUrl,
|
||||
this.eventDate,
|
||||
this.imageUrl,
|
||||
required this.location,
|
||||
@@ -40,9 +42,9 @@ class EventHeader extends StatelessWidget {
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundColor: Colors.grey.shade800,
|
||||
backgroundImage: imageUrl != null && imageUrl!.isNotEmpty
|
||||
? NetworkImage(imageUrl!)
|
||||
: const AssetImage('lib/assets/images/placeholder.png') as ImageProvider,
|
||||
backgroundImage: profileImageUrl.isNotEmpty
|
||||
? NetworkImage(profileImageUrl)
|
||||
: AssetImage(profileImageUrl) as ImageProvider,
|
||||
radius: 22,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -51,7 +53,7 @@ class EventHeader extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'$userFirstName $userLastName',
|
||||
'$creatorFirstName $creatorLastName',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
@@ -91,11 +93,12 @@ class EventHeader extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
// Ajout des boutons dans le coin supérieur droit
|
||||
// Placement des icônes avec padding pour éviter qu'elles ne soient trop proches du bord
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
right: -5,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
key: menuKey,
|
||||
@@ -105,6 +108,7 @@ class EventHeader extends StatelessWidget {
|
||||
showEventOptions(menuContext, menuKey);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 0), // Espacement entre les icônes
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close, color: Colors.white54, size: 20),
|
||||
splashRadius: 20,
|
||||
|
||||
Reference in New Issue
Block a user