Refactor event type handling and add data management page (options and event types)
This commit is contained in:
@@ -6,7 +6,7 @@ import 'package:em2rp/models/event_type_model.dart';
|
||||
class EventBasicInfoSection extends StatelessWidget {
|
||||
final TextEditingController nameController;
|
||||
final TextEditingController basePriceController;
|
||||
final List<EventType> eventTypes;
|
||||
final List<EventTypeModel> eventTypes;
|
||||
final bool isLoadingEventTypes;
|
||||
final String? selectedEventTypeId;
|
||||
final DateTime? startDateTime;
|
||||
|
||||
@@ -67,7 +67,9 @@ class EventOptionsDisplayWidget extends StatelessWidget {
|
||||
return ListTile(
|
||||
leading: Icon(Icons.tune, color: AppColors.rouge),
|
||||
title: Text(
|
||||
opt['name'] ?? '',
|
||||
opt['code'] != null && opt['code'].toString().isNotEmpty
|
||||
? '${opt['code']} - ${opt['name'] ?? ''}'
|
||||
: opt['name'] ?? '',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
subtitle: opt['details'] != null && opt['details'].toString().trim().isNotEmpty
|
||||
@@ -160,6 +162,7 @@ class EventOptionsDisplayWidget extends StatelessWidget {
|
||||
// Combiner les données Firestore avec le prix choisi
|
||||
enrichedOptions.add({
|
||||
'id': optionData['id'],
|
||||
'code': firestoreData['code'] ?? optionData['id'], // Récupérer le code depuis Firestore
|
||||
'name': firestoreData['name'], // Récupéré depuis Firestore
|
||||
'details': firestoreData['details'] ?? '', // Récupéré depuis Firestore
|
||||
'price': optionData['price'], // Prix choisi par l'utilisateur
|
||||
|
||||
Reference in New Issue
Block a user