feat: ajout de champs jauge et contact mail et télphone.
Changement des icons de l'app
This commit is contained in:
@@ -6,6 +6,9 @@ class EventDetailsSection extends StatefulWidget {
|
||||
final TextEditingController installationController;
|
||||
final TextEditingController disassemblyController;
|
||||
final TextEditingController addressController;
|
||||
final TextEditingController jaugeController;
|
||||
final TextEditingController contactEmailController;
|
||||
final TextEditingController contactPhoneController;
|
||||
final bool isMobile;
|
||||
final VoidCallback onAnyFieldChanged;
|
||||
|
||||
@@ -15,6 +18,9 @@ class EventDetailsSection extends StatefulWidget {
|
||||
required this.installationController,
|
||||
required this.disassemblyController,
|
||||
required this.addressController,
|
||||
required this.jaugeController,
|
||||
required this.contactEmailController,
|
||||
required this.contactPhoneController,
|
||||
required this.isMobile,
|
||||
required this.onAnyFieldChanged,
|
||||
});
|
||||
@@ -51,27 +57,15 @@ class _EventDetailsSectionState extends State<EventDetailsSection> {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_buildSectionTitle('Détails'),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 48,
|
||||
maxHeight: widget.isMobile ? 48.0 * 20 : 48.0 * 10,
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: widget.descriptionController,
|
||||
minLines: 1,
|
||||
maxLines: _descriptionMaxLines > (widget.isMobile ? 20 : 10)
|
||||
? (widget.isMobile ? 20 : 10)
|
||||
: _descriptionMaxLines,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Description',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.description),
|
||||
),
|
||||
onChanged: (_) => widget.onAnyFieldChanged(),
|
||||
),
|
||||
),
|
||||
|
||||
// Description et champs de contact
|
||||
widget.isMobile
|
||||
? _buildMobileLayout()
|
||||
: _buildDesktopLayout(),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// Installation et démontage
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -93,6 +87,7 @@ class _EventDetailsSectionState extends State<EventDetailsSection> {
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
_buildSectionTitle('Adresse*'),
|
||||
TextFormField(
|
||||
controller: widget.addressController,
|
||||
@@ -108,6 +103,100 @@ class _EventDetailsSectionState extends State<EventDetailsSection> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMobileLayout() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_buildDescriptionField(),
|
||||
const SizedBox(height: 16),
|
||||
_buildContactFields(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDesktopLayout() {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: _buildDescriptionField(),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: _buildContactFields(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDescriptionField() {
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 48,
|
||||
maxHeight: widget.isMobile ? 48.0 * 20 : 48.0 * 10,
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: widget.descriptionController,
|
||||
minLines: 1,
|
||||
maxLines: _descriptionMaxLines > (widget.isMobile ? 20 : 10)
|
||||
? (widget.isMobile ? 20 : 10)
|
||||
: _descriptionMaxLines,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Description',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.description),
|
||||
),
|
||||
onChanged: (_) => widget.onAnyFieldChanged(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildContactFields() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: widget.jaugeController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Jauge',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.people),
|
||||
hintText: 'Nombre de personnes',
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
onChanged: (_) => widget.onAnyFieldChanged(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextFormField(
|
||||
controller: widget.contactEmailController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Email de contact',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.email),
|
||||
hintText: 'contact@exemple.com',
|
||||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
onChanged: (_) => widget.onAnyFieldChanged(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextFormField(
|
||||
controller: widget.contactPhoneController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Téléphone de contact',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.phone),
|
||||
hintText: '06 12 34 56 78',
|
||||
),
|
||||
keyboardType: TextInputType.phone,
|
||||
onChanged: (_) => widget.onAnyFieldChanged(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSectionTitle(String title) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 16.0, bottom: 8.0),
|
||||
|
||||
Reference in New Issue
Block a user