Refactoring + Checkpoint

This commit is contained in:
DahoudG
2024-11-17 23:00:18 +00:00
parent 1e888f41e8
commit 77ab8a02a2
56 changed files with 1904 additions and 790 deletions

View File

@@ -3,8 +3,14 @@ import 'package:flutter/material.dart';
class DatePickerField extends StatelessWidget {
final DateTime? selectedDate;
final Function(DateTime?) onDatePicked;
final String label; // Texte du label
const DatePickerField({Key? key, this.selectedDate, required this.onDatePicked}) : super(key: key);
const DatePickerField({
Key? key,
this.selectedDate,
required this.onDatePicked,
this.label = 'Sélectionnez une date', // Label par défaut
}) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -21,21 +27,36 @@ class DatePickerField extends StatelessWidget {
}
},
child: Container(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0),
padding: const EdgeInsets.symmetric(vertical: 14.0, horizontal: 18.0),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.1),
borderRadius: BorderRadius.circular(10.0),
color: Colors.blueGrey.withOpacity(0.1), // Fond plus doux et moderne
borderRadius: BorderRadius.circular(12.0), // Coins arrondis plus prononcés
border: Border.all(color: Colors.blueGrey.withOpacity(0.5), width: 2.0), // Bordure légère
boxShadow: [
BoxShadow(
color: Colors.black12,
offset: Offset(0, 4),
blurRadius: 8,
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
selectedDate == null
? 'Sélectionnez une date'
? label
: '${selectedDate!.day}/${selectedDate!.month}/${selectedDate!.year}',
style: const TextStyle(color: Colors.white70),
style: const TextStyle(
color: Colors.blueGrey, // Couleur du texte adaptée
fontSize: 16.0, // Taille de police améliorée
fontWeight: FontWeight.w600, // Poids de police plus important pour un meilleur contraste
),
),
Icon(
Icons.calendar_today,
color: Colors.blueGrey, // Couleur de l'icône assortie au texte
),
const Icon(Icons.calendar_today, color: Colors.white70),
],
),
),